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
+19
-18
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// RadioStation represents a radio station
|
||||
// RadioStation represents a radio station from the Yandex Music API.
|
||||
type RadioStation struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -16,7 +17,7 @@ type RadioStation struct {
|
||||
IsPersonal bool `json:"is_personal"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a RadioStation from JSON
|
||||
// DeJSON deserializes a RadioStation from JSON data.
|
||||
func (r *RadioStation) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -50,7 +51,7 @@ func (r *RadioStation) DeJSON(data []byte, client ClientInterface) (Model, error
|
||||
return station, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of RadioStations
|
||||
// DeList deserializes a list of RadioStations from JSON data.
|
||||
func (r *RadioStation) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -68,7 +69,7 @@ func (r *RadioStation) DeList(data []byte, client ClientInterface) ([]Model, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// StationTracksResult represents station tracks result
|
||||
// StationTracksResult represents station tracks result.
|
||||
type StationTracksResult struct {
|
||||
BaseModel
|
||||
Tracks []Track `json:"tracks"`
|
||||
@@ -76,7 +77,7 @@ type StationTracksResult struct {
|
||||
Sequence string `json:"sequence"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes StationTracksResult from JSON
|
||||
// DeJSON deserializes StationTracksResult from JSON data.
|
||||
func (s *StationTracksResult) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -100,7 +101,7 @@ func (s *StationTracksResult) DeJSON(data []byte, client ClientInterface) (Model
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of StationTracksResult
|
||||
// DeList deserializes a list of StationTracksResult from JSON data.
|
||||
func (s *StationTracksResult) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -118,7 +119,7 @@ func (s *StationTracksResult) DeList(data []byte, client ClientInterface) ([]Mod
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// RotorStation represents a rotor (generative) station
|
||||
// RotorStation represents a rotor (generative) station.
|
||||
type RotorStation struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -131,7 +132,7 @@ type RotorStation struct {
|
||||
Settings *RotorSettings `json:"settings"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a RotorStation from JSON
|
||||
// DeJSON deserializes a RotorStation from JSON data.
|
||||
func (r *RotorStation) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -170,7 +171,7 @@ func (r *RotorStation) DeJSON(data []byte, client ClientInterface) (Model, error
|
||||
return station, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of RotorStations
|
||||
// DeList deserializes a list of RotorStations from JSON data.
|
||||
func (r *RotorStation) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -188,7 +189,7 @@ func (r *RotorStation) DeList(data []byte, client ClientInterface) ([]Model, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// RotorSettings represents rotor station settings
|
||||
// RotorSettings represents rotor station settings.
|
||||
type RotorSettings struct {
|
||||
BaseModel
|
||||
Diversity float64 `json:"diversity"`
|
||||
@@ -201,7 +202,7 @@ type RotorSettings struct {
|
||||
Valence float64 `json:"valence"`
|
||||
}
|
||||
|
||||
// RotorStationTracksResult represents rotor station tracks result
|
||||
// RotorStationTracksResult represents rotor station tracks result.
|
||||
type RotorStationTracksResult struct {
|
||||
BaseModel
|
||||
Tracks []Track `json:"tracks"`
|
||||
@@ -209,7 +210,7 @@ type RotorStationTracksResult struct {
|
||||
Sequence string `json:"sequence"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes RotorStationTracksResult from JSON
|
||||
// DeJSON deserializes RotorStationTracksResult from JSON data.
|
||||
func (r *RotorStationTracksResult) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -233,7 +234,7 @@ func (r *RotorStationTracksResult) DeJSON(data []byte, client ClientInterface) (
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of RotorStationTracksResult
|
||||
// DeList deserializes a list of RotorStationTracksResult from JSON data.
|
||||
func (r *RotorStationTracksResult) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -251,7 +252,7 @@ func (r *RotorStationTracksResult) DeList(data []byte, client ClientInterface) (
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// RotorSession represents a rotor session
|
||||
// RotorSession represents a rotor session.
|
||||
type RotorSession struct {
|
||||
BaseModel
|
||||
SessionID string `json:"session_id"`
|
||||
@@ -262,7 +263,7 @@ type RotorSession struct {
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a RotorSession from JSON
|
||||
// DeJSON deserializes a RotorSession from JSON data.
|
||||
func (r *RotorSession) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -295,7 +296,7 @@ func (r *RotorSession) DeJSON(data []byte, client ClientInterface) (Model, error
|
||||
return session, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of RotorSessions
|
||||
// DeList deserializes a list of RotorSessions from JSON data.
|
||||
func (r *RotorSession) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -313,7 +314,7 @@ func (r *RotorSession) DeList(data []byte, client ClientInterface) ([]Model, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// SessionFeedback represents session feedback
|
||||
// SessionFeedback represents session feedback.
|
||||
type SessionFeedback struct {
|
||||
BaseModel
|
||||
TrackID string `json:"track_id"`
|
||||
@@ -321,7 +322,7 @@ type SessionFeedback struct {
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
// SessionFeedbacks represents multiple session feedbacks
|
||||
// SessionFeedbacks represents multiple session feedbacks.
|
||||
type SessionFeedbacks struct {
|
||||
BaseModel
|
||||
Feedbacks []SessionFeedback `json:"feedbacks"`
|
||||
|
||||
Reference in new issue
Block a user