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
+10
-9
@@ -1,10 +1,11 @@
|
||||
// Package models provides data models for the Yandex Music API.
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// Pin represents a pin
|
||||
// Pin represents a pin from the Yandex Music API.
|
||||
type Pin struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -22,7 +23,7 @@ type Pin struct {
|
||||
Active bool `json:"active"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Pin from JSON
|
||||
// DeJSON deserializes a Pin from JSON data.
|
||||
func (p *Pin) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -83,7 +84,7 @@ func (p *Pin) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return pin, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Pins
|
||||
// DeList deserializes a list of Pins from JSON data.
|
||||
func (p *Pin) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
@@ -101,14 +102,14 @@ func (p *Pin) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PinData represents pin data
|
||||
// PinData represents pin data.
|
||||
type PinData struct {
|
||||
BaseModel
|
||||
Pins []Pin `json:"pins"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// PinsList represents a list of pins
|
||||
// PinsList represents a list of pins.
|
||||
type PinsList struct {
|
||||
BaseModel
|
||||
Pins []Pin `json:"pins"`
|
||||
@@ -117,7 +118,7 @@ type PinsList struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// Presaves represents presaves
|
||||
// Presaves represents presaves.
|
||||
type Presaves struct {
|
||||
BaseModel
|
||||
Presaves []Presave `json:"presaves"`
|
||||
@@ -126,7 +127,7 @@ type Presaves struct {
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// Presave represents a presave
|
||||
// Presave represents a presave.
|
||||
type Presave struct {
|
||||
BaseModel
|
||||
ID string `json:"id"`
|
||||
@@ -142,7 +143,7 @@ type Presave struct {
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a Presave from JSON
|
||||
// DeJSON deserializes a Presave from JSON data.
|
||||
func (p *Presave) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
var raw map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &raw); err != nil {
|
||||
@@ -195,7 +196,7 @@ func (p *Presave) DeJSON(data []byte, client ClientInterface) (Model, error) {
|
||||
return presave, nil
|
||||
}
|
||||
|
||||
// DeList deserializes a list of Presaves
|
||||
// DeList deserializes a list of Presaves from JSON data.
|
||||
func (p *Presave) DeList(data []byte, client ClientInterface) ([]Model, error) {
|
||||
var rawList []json.RawMessage
|
||||
if err := json.Unmarshal(data, &rawList); err != nil {
|
||||
|
||||
Reference in new issue
Block a user