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
-11
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Playlist represents a playlist
|
||||
// Playlist represents a playlist from the Yandex Music API.
|
||||
type Playlist struct {
|
||||
BaseModel
|
||||
Kind int `json:"kind"`
|
||||
@@ -36,7 +37,7 @@ type Playlist struct {
|
||||
Trailer *TrailerInfo `json:"trailer"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Playlist from JSON
|
||||
// DeJSON deserializes a Playlist from JSON data.
|
||||
func (p *Playlist) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -142,7 +143,7 @@ func (p *Playlist) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return playlist, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Playlists
|
||||
// DeList deserializes a list of Playlists from JSON data.
|
||||
func (p *Playlist) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -160,7 +161,7 @@ func (p *Playlist) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// User represents a user (playlist owner)
|
||||
// User represents a user (playlist owner) from the Yandex Music API.
|
||||
type User struct {
|
||||
BaseModel
|
||||
UID int64 `json:"uid"`
|
||||
@@ -184,7 +185,7 @@ type User struct {
|
||||
Counters *UserCounters `json:"counters"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a User from JSON
|
||||
// DeJSON deserializes a User from JSON data.
|
||||
func (u *User) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -255,7 +256,7 @@ func (u *User) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return user, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Users
|
||||
// DeList deserializes a list of Users from JSON data.
|
||||
func (u *User) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -273,7 +274,7 @@ func (u *User) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// UserSettings represents user settings (from /account/settings)
|
||||
// UserSettings represents user settings from /account/settings.
|
||||
type UserSettings struct {
|
||||
BaseModel
|
||||
UID int64 `json:"uid"`
|
||||
@@ -295,7 +296,7 @@ type UserSettings struct {
|
||||
ShowDiskTracksInLibrary *bool `json:"show_disk_tracks_in_library,omitempty"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes UserSettings from JSON
|
||||
// DeJSON deserializes UserSettings from JSON data.
|
||||
func (u *UserSettings) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -365,7 +366,7 @@ func (u *UserSettings) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of UserSettings
|
||||
// DeList deserializes a list of UserSettings from JSON data.
|
||||
func (u *UserSettings) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -383,7 +384,7 @@ func (u *UserSettings) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// UserCounters represents user counters
|
||||
// UserCounters represents user counters.
|
||||
type UserCounters struct {
|
||||
Tracks int `json:"tracks"`
|
||||
Albums int `json:"albums"`
|
||||
@@ -393,7 +394,7 @@ type UserCounters struct {
|
||||
Likes int `json:"likes"`
|
||||
}
|
||||
|
||||
// Image represents an image with multiple sizes
|
||||
// Image represents an image with multiple sizes.
|
||||
type Image struct {
|
||||
URI string `json:"uri"`
|
||||
Type string `json:"type"`
|
||||
|
||||
Reference in new issue
Block a user