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 (
|
||||
@@ -7,7 +8,8 @@ import (
|
||||
"gitea.mrixs.me/Mrixs/yandex-music-api-go/internal/utils"
|
||||
)
|
||||
|
||||
// GetAlbums gets albums by IDs
|
||||
// GetAlbums gets albums by their IDs (GET /tracks?album-ids=...).
|
||||
// Returns a slice of Album pointers, or nil if no IDs are provided.
|
||||
func (c *Client) GetAlbums(ctx context.Context, albumIDs []string) ([]*models.Album, error) {
|
||||
if len(albumIDs) == 0 {
|
||||
return nil, nil
|
||||
@@ -30,7 +32,8 @@ func (c *Client) GetAlbums(ctx context.Context, albumIDs []string) ([]*models.Al
|
||||
return albums, nil
|
||||
}
|
||||
|
||||
// GetAlbum gets a single album by ID
|
||||
// GetAlbum gets a single album by ID using GetAlbums.
|
||||
// Returns an error if no album is found with the given ID.
|
||||
func (c *Client) GetAlbum(ctx context.Context, albumID string) (*models.Album, error) {
|
||||
albums, err := c.GetAlbums(ctx, []string{albumID})
|
||||
if err != nil {
|
||||
@@ -42,7 +45,8 @@ func (c *Client) GetAlbum(ctx context.Context, albumID string) (*models.Album, e
|
||||
return albums[0], nil
|
||||
}
|
||||
|
||||
// GetAlbumsWithTracks gets albums with tracks expanded
|
||||
// GetAlbumsWithTracks gets albums with tracks expanded (GET /tracks?with-tracks=true).
|
||||
// Returns a slice of Album pointers with their tracks populated.
|
||||
func (c *Client) GetAlbumsWithTracks(ctx context.Context, albumIDs []string) ([]*models.Album, error) {
|
||||
if len(albumIDs) == 0 {
|
||||
return nil, nil
|
||||
|
||||
Reference in new issue
Block a user