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
+13
-12
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Queue represents a playback queue
|
||||
// Queue represents a playback queue from the Yandex Music API.
|
||||
type Queue struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -20,7 +21,7 @@ type Queue struct {
|
||||
TotalDuration int `json:"total_duration_ms"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Queue from JSON
|
||||
// DeJSON deserializes a Queue from JSON data.
|
||||
func (q *Queue) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -71,7 +72,7 @@ func (q *Queue) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return queue, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Queues
|
||||
// DeList deserializes a list of Queues from JSON data.
|
||||
func (q *Queue) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -89,7 +90,7 @@ func (q *Queue) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// QueueItem represents a queue item
|
||||
// QueueItem represents a queue item.
|
||||
type QueueItem struct {
|
||||
BaseModel
|
||||
TrackID string `json:"track_id"`
|
||||
@@ -101,7 +102,7 @@ type QueueItem struct {
|
||||
PlayContext *PlayContext `json:"play_context"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a QueueItem from JSON
|
||||
// DeJSON deserializes a QueueItem from JSON data.
|
||||
func (qi *QueueItem) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -140,7 +141,7 @@ func (qi *QueueItem) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return item, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of QueueItems
|
||||
// DeList deserializes a list of QueueItems from JSON data.
|
||||
func (qi *QueueItem) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -158,7 +159,7 @@ func (qi *QueueItem) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PlayContext represents a play context
|
||||
// PlayContext represents a play context.
|
||||
type PlayContext struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -173,7 +174,7 @@ type PlayContext struct {
|
||||
Available bool `json:"available"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a PlayContext from JSON
|
||||
// DeJSON deserializes a PlayContext from JSON data.
|
||||
func (pc *PlayContext) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -219,7 +220,7 @@ func (pc *PlayContext) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of PlayContexts
|
||||
// DeList deserializes a list of PlayContexts from JSON data.
|
||||
func (pc *PlayContext) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -237,7 +238,7 @@ func (pc *PlayContext) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PlayContextsData represents play contexts data
|
||||
// PlayContextsData represents play contexts data.
|
||||
type PlayContextsData struct {
|
||||
BaseModel
|
||||
Contexts []PlayContext `json:"contexts"`
|
||||
@@ -246,7 +247,7 @@ type PlayContextsData struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes PlayContextsData from JSON
|
||||
// DeJSON deserializes PlayContextsData from JSON data.
|
||||
func (pcd *PlayContextsData) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -273,7 +274,7 @@ func (pcd *PlayContextsData) DeJSON(data []byte, c ClientInterface) (Model, erro
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of PlayContextsData
|
||||
// DeList deserializes a list of PlayContextsData from JSON data.
|
||||
func (pcd *PlayContextsData) 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