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:
MrixsandClaude Code committed 2026-10-18 08:57:43 +03:00
1 parent 7a68ad86cb
commit 0456ca0665
54 files changed
+1097 -652

No files matched your search

+17 -16
View File
@@ -1,10 +1,11 @@
// Package models provides data models for the Yandex Music API.
package models
import (
"encoding/json"
)
// Artist represents a full artist
// Artist represents a full artist from the Yandex Music API.
type Artist struct {
BaseModel
ID string `json:"id"`
@@ -34,7 +35,7 @@ type Artist struct {
TracksData []Track `json:"tracks_data"`
}
// DeJSON deserializes an Artist from JSON
// DeJSON deserializes an Artist from JSON data.
func (a *Artist) DeJSON(data []byte, c ClientInterface) (Model, error) {
var raw map[string]json.RawMessage
if err := json.Unmarshal(data, &raw); err != nil {
@@ -146,7 +147,7 @@ func (a *Artist) DeJSON(data []byte, c ClientInterface) (Model, error) {
return artist, nil
}
// DeList deserializes a list of Artists
// DeList deserializes a list of Artists from JSON data.
func (a *Artist) DeList(data []byte, c ClientInterface) ([]Model, error) {
var rawList []json.RawMessage
if err := json.Unmarshal(data, &rawList); err != nil {
@@ -164,27 +165,27 @@ func (a *Artist) DeList(data []byte, c ClientInterface) ([]Model, error) {
return result, nil
}
// Ratings represents artist ratings
// Ratings represents artist ratings.
type Ratings struct {
Rating float64 `json:"rating"`
Votes int `json:"votes"`
}
// Counts represents artist counts
// Counts represents artist counts.
type Counts struct {
Tracks int `json:"tracks"`
Albums int `json:"albums"`
Folders int `json:"folders"`
}
// SocialLink represents a social media link
// SocialLink represents a social media link.
type SocialLink struct {
URL string `json:"url"`
Title string `json:"title"`
Type string `json:"type"`
}
// Cover represents cover image info
// Cover represents cover image info.
type Cover struct {
URI string `json:"uri"`
Type string `json:"type"`
@@ -193,13 +194,13 @@ type Cover struct {
Background string `json:"background"`
}
// ArtistBriefInfo represents brief artist info
// ArtistBriefInfo represents brief artist info.
type ArtistBriefInfo struct {
Description string `json:"description"`
Available bool `json:"available"`
}
// ArtistDonations represents artist donations info
// ArtistDonations represents artist donations info.
type ArtistDonations struct {
Items []DonationItem `json:"items"`
Total int `json:"total"`
@@ -207,7 +208,7 @@ type ArtistDonations struct {
Raised int `json:"raised"`
}
// DonationItem represents a donation item
// DonationItem represents a donation item.
type DonationItem struct {
ID string `json:"id"`
Title string `json:"title"`
@@ -218,7 +219,7 @@ type DonationItem struct {
Currency string `json:"currency"`
}
// ConcertShort represents a concert (minimal for artist)
// ConcertShort represents a concert (minimal for artist).
type ConcertShort struct {
BaseModel
ID string `json:"id"`
@@ -233,7 +234,7 @@ type ConcertShort struct {
Available bool `json:"available"`
}
// DeJSON deserializes a ConcertShort from JSON
// DeJSON deserializes a ConcertShort from JSON data.
func (c *ConcertShort) DeJSON(data []byte, client ClientInterface) (Model, error) {
var raw map[string]json.RawMessage
if err := json.Unmarshal(data, &raw); err != nil {
@@ -276,7 +277,7 @@ func (c *ConcertShort) DeJSON(data []byte, client ClientInterface) (Model, error
return concert, nil
}
// DeList deserializes a list of ConcertShort
// DeList deserializes a list of ConcertShort from JSON data.
func (c *ConcertShort) DeList(data []byte, client ClientInterface) ([]Model, error) {
var rawList []json.RawMessage
if err := json.Unmarshal(data, &rawList); err != nil {
@@ -294,7 +295,7 @@ func (c *ConcertShort) DeList(data []byte, client ClientInterface) ([]Model, err
return result, nil
}
// ClipShort represents a clip (minimal for artist)
// ClipShort represents a clip (minimal for artist).
type ClipShort struct {
BaseModel
ID string `json:"id"`
@@ -308,7 +309,7 @@ type ClipShort struct {
CreatedAt string `json:"created_at"`
}
// DeJSON deserializes a ClipShort from JSON
// DeJSON deserializes a ClipShort from JSON data.
func (c *ClipShort) DeJSON(data []byte, client ClientInterface) (Model, error) {
var raw map[string]json.RawMessage
if err := json.Unmarshal(data, &raw); err != nil {
@@ -348,7 +349,7 @@ func (c *ClipShort) DeJSON(data []byte, client ClientInterface) (Model, error) {
return clip, nil
}
// DeList deserializes a list of ClipShort
// DeList deserializes a list of ClipShort from JSON data.
func (c *ClipShort) DeList(data []byte, client ClientInterface) ([]Model, error) {
var rawList []json.RawMessage
if err := json.Unmarshal(data, &rawList); err != nil {