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,17 +1,18 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Credits represents track credits
|
||||
// Credits represents track credits from the Yandex Music API.
|
||||
type Credits struct {
|
||||
BaseModel
|
||||
Items []Credit `json:"items"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes Credits from JSON
|
||||
// DeJSON deserializes Credits from JSON data.
|
||||
func (c *Credits) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -32,7 +33,7 @@ func (c *Credits) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return credits, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Credits
|
||||
// DeList deserializes a list of Credits from JSON data. from JSON data.
|
||||
func (c *Credits) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -50,7 +51,7 @@ func (c *Credits) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Credit represents a credit
|
||||
// Credit represents a credit.
|
||||
type Credit struct {
|
||||
BaseModel
|
||||
Role string `json:"role"`
|
||||
@@ -62,7 +63,7 @@ type Credit struct {
|
||||
AlbumID string `json:"album_id"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Credit from JSON
|
||||
// DeJSON deserializes a Credit from JSON data.
|
||||
func (c *Credit) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -114,7 +115,7 @@ func (c *Credit) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// LicenceTextPart represents a licence text part
|
||||
// LicenceTextPart represents a licence text part.
|
||||
type LicenceTextPart struct {
|
||||
BaseModel
|
||||
Text string `json:"text"`
|
||||
@@ -124,7 +125,7 @@ type LicenceTextPart struct {
|
||||
IsMain bool `json:"is_main"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a LicenceTextPart from JSON
|
||||
// DeJSON deserializes a LicenceTextPart from JSON data.
|
||||
func (ltp *LicenceTextPart) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -152,7 +153,7 @@ func (ltp *LicenceTextPart) DeJSON(data []byte, client ClientInterface) (Model,
|
||||
return part, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of LicenceTextPart
|
||||
// DeList deserializes a list of LicenceTextPart from JSON data.
|
||||
func (ltp *LicenceTextPart) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
|
||||
Reference in new issue
Block a user