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"
|
||||
)
|
||||
|
||||
// Clip represents a clip (short video)
|
||||
// Clip represents a clip (short video) from the Yandex Music API.
|
||||
type Clip struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -24,7 +25,7 @@ type Clip struct {
|
||||
AspectRatio string `json:"aspect_ratio"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Clip from JSON
|
||||
// DeJSON deserializes a Clip from JSON data.
|
||||
func (c *Clip) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -89,7 +90,7 @@ func (c *Clip) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return clip, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Clips
|
||||
// DeList deserializes a list of Clips from JSON data.
|
||||
func (c *Clip) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -107,28 +108,28 @@ func (c *Clip) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ClipsWillLike represents clips the user might like
|
||||
// ClipsWillLike represents clips the user might like.
|
||||
type ClipsWillLike struct {
|
||||
BaseModel
|
||||
Clips []Clip `json:"clips"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// ArtistClipData represents artist clip data
|
||||
// ArtistClipData represents artist clip data.
|
||||
type ArtistClipData struct {
|
||||
BaseModel
|
||||
Clips []Clip `json:"clips"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// ArtistClipItem represents an artist clip item
|
||||
// ArtistClipItem represents an artist clip item.
|
||||
type ArtistClipItem struct {
|
||||
BaseModel
|
||||
Clip *Clip `json:"clip"`
|
||||
Index int `json:"index"`
|
||||
}
|
||||
|
||||
// Shot represents a shot (short video)
|
||||
// Shot represents a shot (short video).
|
||||
type Shot struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -150,7 +151,7 @@ type Shot struct {
|
||||
AspectRatio string `json:"aspect_ratio"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Shot from JSON
|
||||
// DeJSON deserializes a Shot from JSON data.
|
||||
func (s *Shot) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -219,7 +220,7 @@ func (s *Shot) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return shot, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Shots
|
||||
// DeList deserializes a list of Shots from JSON data.
|
||||
func (s *Shot) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -237,14 +238,14 @@ func (s *Shot) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ShotData represents shot data
|
||||
// ShotData represents shot data.
|
||||
type ShotData struct {
|
||||
BaseModel
|
||||
Shots []Shot `json:"shots"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// ShotEvent represents a shot event
|
||||
// ShotEvent represents a shot event.
|
||||
type ShotEvent struct {
|
||||
BaseModel
|
||||
EventID string `json:"event_id"`
|
||||
@@ -254,7 +255,7 @@ type ShotEvent struct {
|
||||
Action string `json:"action"`
|
||||
}
|
||||
|
||||
// ShotType represents a shot type
|
||||
// ShotType represents a shot type.
|
||||
type ShotType struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
|
||||
Reference in new issue
Block a user