Add comprehensive godoc documentation to all exported symbols
- Document all exported types, functions, methods, and constants across 52 files - Add package-level doc comments to client, models, utils, and ynison packages - Document HTTP method and endpoint path for each API client method - Document model struct fields and DeJSON/DeList/ToJSON/ToMap methods - Fix duplicate package doc comment in internal/models/base.go Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
7a68ad86cb
commit
0456ca0665
54 files changed
+1097
-652
No files matched your search
@@ -1,3 +1,4 @@
|
||||
// Package client provides methods for interacting with Yandex Music API endpoints.
|
||||
package client
|
||||
|
||||
import (
|
||||
@@ -8,7 +9,8 @@ import (
|
||||
"gitea.mrixs.me/Mrixs/yandex-music-api-go/internal/utils"
|
||||
)
|
||||
|
||||
// GetArtists gets artists by IDs
|
||||
// GetArtists gets artists by their IDs (GET /tracks?artist-ids=...).
|
||||
// Returns a slice of Artist pointers, or nil if no IDs are provided.
|
||||
func (c *Client) GetArtists(ctx context.Context, artistIDs []string) ([]*models.Artist, error) {
|
||||
if len(artistIDs) == 0 {
|
||||
return nil, nil
|
||||
@@ -31,7 +33,8 @@ func (c *Client) GetArtists(ctx context.Context, artistIDs []string) ([]*models.
|
||||
return artists, nil
|
||||
}
|
||||
|
||||
// GetArtist gets a single artist by ID
|
||||
// GetArtist gets a single artist by ID using GetArtists.
|
||||
// Returns an error if no artist is found with the given ID.
|
||||
func (c *Client) GetArtist(ctx context.Context, artistID string) (*models.Artist, error) {
|
||||
artists, err := c.GetArtists(ctx, []string{artistID})
|
||||
if err != nil {
|
||||
@@ -43,8 +46,8 @@ func (c *Client) GetArtist(ctx context.Context, artistID string) (*models.Artist
|
||||
return artists[0], nil
|
||||
}
|
||||
|
||||
// GetArtistAlbums gets albums by an artist
|
||||
// GET /artists/{artist_id}/direct-albums
|
||||
// GetArtistAlbums gets albums by an artist (GET /artists/{artist_id}/direct-albums).
|
||||
// The page and pageSize parameters control pagination.
|
||||
func (c *Client) GetArtistAlbums(ctx context.Context, artistID string, page, pageSize int) (*models.ArtistAlbums, error) {
|
||||
params := map[string]string{
|
||||
"page": fmt.Sprintf("%d", page),
|
||||
@@ -59,8 +62,8 @@ func (c *Client) GetArtistAlbums(ctx context.Context, artistID string, page, pag
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetArtistTracks gets tracks by an artist
|
||||
// GET /artists/{artist_id}/tracks
|
||||
// GetArtistTracks gets tracks by an artist (GET /artists/{artist_id}/tracks).
|
||||
// The page and pageSize parameters control pagination.
|
||||
func (c *Client) GetArtistTracks(ctx context.Context, artistID string, page, pageSize int) (*models.ArtistTracks, error) {
|
||||
params := map[string]string{
|
||||
"page": fmt.Sprintf("%d", page),
|
||||
|
||||
Reference in new issue
Block a user