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"
|
||||
)
|
||||
|
||||
// MusicHistory represents music history
|
||||
// MusicHistory represents music history from the Yandex Music API.
|
||||
type MusicHistory struct {
|
||||
BaseModel
|
||||
Tabs []MusicHistoryTab `json:"tabs"`
|
||||
@@ -13,7 +14,7 @@ type MusicHistory struct {
|
||||
Context *MusicHistoryContextFullModel `json:"context"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a MusicHistory from JSON
|
||||
// DeJSON deserializes a MusicHistory from JSON data.
|
||||
func (mh *MusicHistory) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -46,7 +47,7 @@ func (mh *MusicHistory) DeJSON(data []byte, client ClientInterface) (Model, erro
|
||||
return history, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of MusicHistory
|
||||
// DeList deserializes a list of MusicHistory from JSON data.
|
||||
func (mh *MusicHistory) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -64,7 +65,7 @@ func (mh *MusicHistory) DeList(data []byte, client ClientInterface) ([]Model, er
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// MusicHistoryTab represents a music history tab
|
||||
// MusicHistoryTab represents a music history tab.
|
||||
type MusicHistoryTab struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -75,7 +76,7 @@ type MusicHistoryTab struct {
|
||||
Position int `json:"position"`
|
||||
}
|
||||
|
||||
// MusicHistoryGroup represents a music history group
|
||||
// MusicHistoryGroup represents a music history group.
|
||||
type MusicHistoryGroup struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -85,7 +86,7 @@ type MusicHistoryGroup struct {
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// MusicHistoryItem represents a music history item
|
||||
// MusicHistoryItem represents a music history item.
|
||||
type MusicHistoryItem struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -100,7 +101,7 @@ type MusicHistoryItem struct {
|
||||
Context *MusicHistoryItemData `json:"context"`
|
||||
}
|
||||
|
||||
// MusicHistoryItemData represents music history item data
|
||||
// MusicHistoryItemData represents music history item data.
|
||||
type MusicHistoryItemData struct {
|
||||
BaseModel
|
||||
Source string `json:"source"`
|
||||
@@ -112,14 +113,14 @@ type MusicHistoryItemData struct {
|
||||
Progress float64 `json:"progress"`
|
||||
}
|
||||
|
||||
// MusicHistoryItemID represents music history item ID
|
||||
// MusicHistoryItemID represents music history item ID.
|
||||
type MusicHistoryItemID struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
// MusicHistoryItems represents music history items
|
||||
// MusicHistoryItems represents music history items.
|
||||
type MusicHistoryItems struct {
|
||||
BaseModel
|
||||
Items []MusicHistoryItem `json:"items"`
|
||||
@@ -128,7 +129,7 @@ type MusicHistoryItems struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// MusicHistoryContextFullModel represents music history context full model
|
||||
// MusicHistoryContextFullModel represents music history context full model.
|
||||
type MusicHistoryContextFullModel struct {
|
||||
BaseModel
|
||||
DeviceID string `json:"device_id"`
|
||||
|
||||
Reference in new issue
Block a user