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:
MrixsandClaude Code committed 2026-10-18 08:57:43 +03:00
1 parent 7a68ad86cb
commit 0456ca0665
54 files changed
+1097 -652

No files matched your search

+9 -9
View File
@@ -1,3 +1,4 @@
// Package client provides methods for interacting with Yandex Music API endpoints.
package client
import (
@@ -7,7 +8,7 @@ import (
"gitea.mrixs.me/Mrixs/yandex-music-api-go/internal/models"
)
// GetFeed gets the main feed
// GetFeed gets the main feed (GET /feed).
func (c *Client) GetFeed(ctx context.Context) (*models.Feed, error) {
var result models.Feed
if err := c.request.Get(ctx, "/feed", nil, &result); err != nil {
@@ -16,7 +17,7 @@ func (c *Client) GetFeed(ctx context.Context) (*models.Feed, error) {
return &result, nil
}
// GetFeedBlocks gets feed blocks
// GetFeedBlocks gets feed blocks (GET /feed/blocks).
func (c *Client) GetFeedBlocks(ctx context.Context) ([]*models.DayBlock, error) {
var result []models.DayBlock
if err := c.request.Get(ctx, "/feed/blocks", nil, &result); err != nil {
@@ -31,7 +32,7 @@ func (c *Client) GetFeedBlocks(ctx context.Context) ([]*models.DayBlock, error)
return blocks, nil
}
// GetFeedGeneratedPlaylist gets a generated playlist by ID from feed
// GetFeedGeneratedPlaylist gets a generated playlist by ID from the feed (GET /feed/generated-playlist).
func (c *Client) GetFeedGeneratedPlaylist(ctx context.Context, playlistID string) (*models.GeneratedPlaylist, error) {
params := map[string]string{
"playlist_id": playlistID,
@@ -45,7 +46,7 @@ func (c *Client) GetFeedGeneratedPlaylist(ctx context.Context, playlistID string
return &result, nil
}
// GetFeedDay gets a specific day from the feed
// GetFeedDay gets a specific day from the feed by date (GET /feed/day).
func (c *Client) GetFeedDay(ctx context.Context, date string) (*models.Day, error) {
params := map[string]string{
"date": date,
@@ -58,7 +59,7 @@ func (c *Client) GetFeedDay(ctx context.Context, date string) (*models.Day, erro
return &result, nil
}
// GetGeneratedPlaylists gets generated playlists
// GetGeneratedPlaylists gets generated playlists (GET /generated-playlists).
func (c *Client) GetGeneratedPlaylists(ctx context.Context) ([]*models.GeneratedPlaylist, error) {
var result []models.GeneratedPlaylist
if err := c.request.Get(ctx, "/generated-playlists", nil, &result); err != nil {
@@ -73,8 +74,7 @@ func (c *Client) GetGeneratedPlaylists(ctx context.Context) ([]*models.Generated
return playlists, nil
}
// GetLanding gets a landing page
// GET /landing3/{landingID}
// GetLanding gets a landing page by ID (GET /landing3/{landingID}).
func (c *Client) GetLanding(ctx context.Context, landingID string) (*models.Landing, error) {
params := map[string]string{
"landing_id": landingID,
@@ -87,7 +87,7 @@ func (c *Client) GetLanding(ctx context.Context, landingID string) (*models.Land
return &result, nil
}
// GetLandingList gets a list of landings
// GetLandingList gets a list of landings (GET /landing3/list).
func (c *Client) GetLandingList(ctx context.Context) (*models.LandingList, error) {
var result models.LandingList
if err := c.request.Get(ctx, "/landing3/list", nil, &result); err != nil {
@@ -96,7 +96,7 @@ func (c *Client) GetLandingList(ctx context.Context) (*models.LandingList, error
return &result, nil
}
// GetLandingBlocks gets landing blocks by block IDs
// GetLandingBlocks gets landing blocks by block IDs (GET /landing3/blocks).
func (c *Client) GetLandingBlocks(ctx context.Context, blockIDs []string) ([]*models.LandingBlock, error) {
params := map[string]string{
"blocks": joinStrings(blockIDs, ","),