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,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// TrackShort represents a lightweight track (used in lists)
|
||||
// TrackShort represents a lightweight track used in lists.
|
||||
type TrackShort struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -31,7 +32,7 @@ type TrackShort struct {
|
||||
RingtoneID string `json:"ringtone_id"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a TrackShort from JSON
|
||||
// DeJSON deserializes a TrackShort from JSON data.
|
||||
func (t *TrackShort) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -131,7 +132,7 @@ func (t *TrackShort) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return track, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of TrackShort
|
||||
// DeList deserializes a list of TrackShort from JSON data.
|
||||
func (t *TrackShort) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -149,7 +150,7 @@ func (t *TrackShort) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// TracksList represents a list of tracks with metadata
|
||||
// TracksList represents a list of tracks with metadata.
|
||||
type TracksList struct {
|
||||
BaseModel
|
||||
Tracks []TrackShort `json:"tracks"`
|
||||
@@ -159,7 +160,7 @@ type TracksList struct {
|
||||
Pager *Pager `json:"pager"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a TracksList from JSON
|
||||
// DeJSON deserializes a TracksList from JSON data.
|
||||
func (t *TracksList) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -193,7 +194,7 @@ func (t *TracksList) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of TracksList
|
||||
// DeList deserializes a list of TracksList from JSON data.
|
||||
func (t *TracksList) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
|
||||
Reference in new issue
Block a user