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
+23
-22
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Metatag represents a metatag
|
||||
// Metatag represents a metatag from the Yandex Music API.
|
||||
type Metatag struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -16,7 +17,7 @@ type Metatag struct {
|
||||
Children []Metatag `json:"children"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Metatag from JSON
|
||||
// DeJSON deserializes a Metatag from JSON data.
|
||||
func (m *Metatag) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -52,7 +53,7 @@ func (m *Metatag) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return metatag, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Metatags
|
||||
// DeList deserializes a list of Metatags from JSON data.
|
||||
func (m *Metatag) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -70,14 +71,14 @@ func (m *Metatag) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// MetatagTree represents a metatag tree
|
||||
// MetatagTree represents a metatag tree.
|
||||
type MetatagTree struct {
|
||||
BaseModel
|
||||
Root *Metatag `json:"root"`
|
||||
Leaves []Metatag `json:"leaves"`
|
||||
}
|
||||
|
||||
// MetatagLeaf represents a metatag leaf
|
||||
// MetatagLeaf represents a metatag leaf.
|
||||
type MetatagLeaf struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -88,7 +89,7 @@ type MetatagLeaf struct {
|
||||
Position int `json:"position"`
|
||||
}
|
||||
|
||||
// MetatagArtists represents metatag artists
|
||||
// MetatagArtists represents metatag artists.
|
||||
type MetatagArtists struct {
|
||||
BaseModel
|
||||
Artists []Artist `json:"artists"`
|
||||
@@ -97,7 +98,7 @@ type MetatagArtists struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// MetatagAlbums represents metatag albums
|
||||
// MetatagAlbums represents metatag albums.
|
||||
type MetatagAlbums struct {
|
||||
BaseModel
|
||||
Albums []Album `json:"albums"`
|
||||
@@ -106,7 +107,7 @@ type MetatagAlbums struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// MetatagPlaylists represents metatag playlists
|
||||
// MetatagPlaylists represents metatag playlists.
|
||||
type MetatagPlaylists struct {
|
||||
BaseModel
|
||||
Playlists []Playlist `json:"playlists"`
|
||||
@@ -115,27 +116,27 @@ type MetatagPlaylists struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// MetatagTitle represents a metatag title
|
||||
// MetatagTitle represents a metatag title.
|
||||
type MetatagTitle struct {
|
||||
BaseModel
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// MetatagSortByValue represents metatag sort by value
|
||||
// MetatagSortByValue represents metatag sort by value.
|
||||
type MetatagSortByValue struct {
|
||||
BaseModel
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
// MetatagArtistEntry represents a metatag artist entry
|
||||
// MetatagArtistEntry represents a metatag artist entry.
|
||||
type MetatagArtistEntry struct {
|
||||
BaseModel
|
||||
Artist *Artist `json:"artist"`
|
||||
Score float64 `json:"score"`
|
||||
}
|
||||
|
||||
// Genre represents a genre
|
||||
// Genre represents a genre from the Yandex Music API.
|
||||
type Genre struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -147,7 +148,7 @@ type Genre struct {
|
||||
Children []Genre `json:"children"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Genre from JSON
|
||||
// DeJSON deserializes a Genre from JSON data.
|
||||
func (g *Genre) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -183,7 +184,7 @@ func (g *Genre) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return genre, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Genres
|
||||
// DeList deserializes a list of Genres from JSON data.
|
||||
func (g *Genre) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -201,7 +202,7 @@ func (g *Genre) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Chart represents a chart
|
||||
// Chart represents a chart from the Yandex Music API.
|
||||
type Chart struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -212,7 +213,7 @@ type Chart struct {
|
||||
Items []ChartItem `json:"items"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Chart from JSON
|
||||
// DeJSON deserializes a Chart from JSON data.
|
||||
func (c *Chart) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -245,7 +246,7 @@ func (c *Chart) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return chart, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Charts
|
||||
// DeList deserializes a list of Charts from JSON data.
|
||||
func (c *Chart) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -263,14 +264,14 @@ func (c *Chart) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ChartInfo represents chart info
|
||||
// ChartInfo represents chart info.
|
||||
type ChartInfo struct {
|
||||
BaseModel
|
||||
Chart *Chart `json:"chart"`
|
||||
Menu []ChartInfoMenu `json:"menu"`
|
||||
}
|
||||
|
||||
// ChartItem represents a chart item
|
||||
// ChartItem represents a chart item.
|
||||
type ChartItem struct {
|
||||
BaseModel
|
||||
Position int `json:"position"`
|
||||
@@ -282,7 +283,7 @@ type ChartItem struct {
|
||||
Trend string `json:"trend"`
|
||||
}
|
||||
|
||||
// ChartInfoMenu represents a chart info menu
|
||||
// ChartInfoMenu represents a chart info menu.
|
||||
type ChartInfoMenu struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -291,7 +292,7 @@ type ChartInfoMenu struct {
|
||||
Items []ChartInfoMenuItem `json:"items"`
|
||||
}
|
||||
|
||||
// ChartInfoMenuItem represents a chart info menu item
|
||||
// ChartInfoMenuItem represents a chart info menu item.
|
||||
type ChartInfoMenuItem struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -300,7 +301,7 @@ type ChartInfoMenuItem struct {
|
||||
Action string `json:"action"`
|
||||
}
|
||||
|
||||
// ChartItems represents chart items response
|
||||
// ChartItems represents chart items response.
|
||||
type ChartItems struct {
|
||||
BaseModel
|
||||
Items []ChartItem `json:"items"`
|
||||
|
||||
Reference in new issue
Block a user