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
+12
-10
@@ -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/models"
|
||||
)
|
||||
|
||||
// Search performs a multi-type search
|
||||
// Search performs a multi-type search (GET /search).
|
||||
// The searchType parameter specifies what to search for (e.g., "track", "album", "artist").
|
||||
func (c *Client) Search(ctx context.Context, query string, searchType string, page, pageSize int) (*models.SearchResult, error) {
|
||||
params := map[string]string{
|
||||
"text": query,
|
||||
@@ -46,7 +48,7 @@ func (c *Client) Search(ctx context.Context, query string, searchType string, pa
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// SearchTracks searches for tracks
|
||||
// SearchTracks searches for tracks using Search with type "track".
|
||||
func (c *Client) SearchTracks(ctx context.Context, query string, page, pageSize int) (*models.SearchTracksResult, error) {
|
||||
result, err := c.Search(ctx, query, "track", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -55,7 +57,7 @@ func (c *Client) SearchTracks(ctx context.Context, query string, page, pageSize
|
||||
return result.Tracks, nil
|
||||
}
|
||||
|
||||
// SearchAlbums searches for albums
|
||||
// SearchAlbums searches for albums using Search with type "album".
|
||||
func (c *Client) SearchAlbums(ctx context.Context, query string, page, pageSize int) (*models.SearchAlbumsResult, error) {
|
||||
result, err := c.Search(ctx, query, "album", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -64,7 +66,7 @@ func (c *Client) SearchAlbums(ctx context.Context, query string, page, pageSize
|
||||
return result.Albums, nil
|
||||
}
|
||||
|
||||
// SearchArtists searches for artists
|
||||
// SearchArtists searches for artists using Search with type "artist".
|
||||
func (c *Client) SearchArtists(ctx context.Context, query string, page, pageSize int) (*models.SearchArtistsResult, error) {
|
||||
result, err := c.Search(ctx, query, "artist", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -73,7 +75,7 @@ func (c *Client) SearchArtists(ctx context.Context, query string, page, pageSize
|
||||
return result.Artists, nil
|
||||
}
|
||||
|
||||
// SearchPlaylists searches for playlists
|
||||
// SearchPlaylists searches for playlists using Search with type "playlist".
|
||||
func (c *Client) SearchPlaylists(ctx context.Context, query string, page, pageSize int) (*models.SearchPlaylistsResult, error) {
|
||||
result, err := c.Search(ctx, query, "playlist", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -82,7 +84,7 @@ func (c *Client) SearchPlaylists(ctx context.Context, query string, page, pageSi
|
||||
return result.Playlists, nil
|
||||
}
|
||||
|
||||
// SearchVideos searches for videos
|
||||
// SearchVideos searches for videos using Search with type "video".
|
||||
func (c *Client) SearchVideos(ctx context.Context, query string, page, pageSize int) (*models.SearchVideosResult, error) {
|
||||
result, err := c.Search(ctx, query, "video", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -91,7 +93,7 @@ func (c *Client) SearchVideos(ctx context.Context, query string, page, pageSize
|
||||
return result.Videos, nil
|
||||
}
|
||||
|
||||
// SearchUsers searches for users
|
||||
// SearchUsers searches for users using Search with type "user".
|
||||
func (c *Client) SearchUsers(ctx context.Context, query string, page, pageSize int) (*models.SearchUsersResult, error) {
|
||||
result, err := c.Search(ctx, query, "user", page, pageSize)
|
||||
if err != nil {
|
||||
@@ -100,7 +102,7 @@ func (c *Client) SearchUsers(ctx context.Context, query string, page, pageSize i
|
||||
return result.Users, nil
|
||||
}
|
||||
|
||||
// SearchSuggestions gets search suggestions
|
||||
// SearchSuggestions gets search suggestions for a query (GET /search/suggest?type=suggest).
|
||||
func (c *Client) SearchSuggestions(ctx context.Context, query string) ([]string, error) {
|
||||
params := map[string]string{
|
||||
"text": query,
|
||||
@@ -116,7 +118,7 @@ func (c *Client) SearchSuggestions(ctx context.Context, query string) ([]string,
|
||||
return result.Suggestions, nil
|
||||
}
|
||||
|
||||
// SearchBanners gets search banners
|
||||
// SearchBanners gets search banners for a query (GET /search/banner?type=banner).
|
||||
func (c *Client) SearchBanners(ctx context.Context, query string) ([]models.SearchBanner, error) {
|
||||
params := map[string]string{
|
||||
"text": query,
|
||||
@@ -132,7 +134,7 @@ func (c *Client) SearchBanners(ctx context.Context, query string) ([]models.Sear
|
||||
return result.Banners, nil
|
||||
}
|
||||
|
||||
// SearchTags gets search tags
|
||||
// SearchTags gets search tags for a query (GET /search/tag?type=tag).
|
||||
func (c *Client) SearchTags(ctx context.Context, query string) ([]models.Tag, error) {
|
||||
params := map[string]string{
|
||||
"text": query,
|
||||
|
||||
Reference in new issue
Block a user