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
+11
-16
@@ -1,3 +1,4 @@
|
||||
// Package client provides methods for interacting with Yandex Music API endpoints.
|
||||
package client
|
||||
|
||||
import (
|
||||
@@ -7,7 +8,7 @@ import (
|
||||
"gitea.mrixs.me/Mrixs/yandex-music-api-go/internal/models"
|
||||
)
|
||||
|
||||
// GetRadioStations gets radio stations
|
||||
// GetRadioStations gets radio stations (GET /radio/stations).
|
||||
func (c *Client) GetRadioStations(ctx context.Context) ([]*models.RadioStation, error) {
|
||||
var result []models.RadioStation
|
||||
if err := c.request.Get(ctx, "/radio/stations", nil, &result); err != nil {
|
||||
@@ -22,8 +23,7 @@ func (c *Client) GetRadioStations(ctx context.Context) ([]*models.RadioStation,
|
||||
return stations, nil
|
||||
}
|
||||
|
||||
// GetRadioStation gets a radio station by ID
|
||||
// GET /rotor/station/{stationID}/info
|
||||
// GetRadioStation gets a radio station by ID (GET /rotor/station/{stationID}/info).
|
||||
func (c *Client) GetRadioStation(ctx context.Context, stationID string) (*models.RadioStation, error) {
|
||||
var result models.RadioStation
|
||||
if err := c.request.Get(ctx, fmt.Sprintf("/rotor/station/%s/info", stationID), nil, &result); err != nil {
|
||||
@@ -33,8 +33,7 @@ func (c *Client) GetRadioStation(ctx context.Context, stationID string) (*models
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetStationTracks gets tracks for a radio station
|
||||
// GET /rotor/station/{stationID}/tracks
|
||||
// GetStationTracks gets tracks for a radio station (GET /rotor/station/{stationID}/tracks).
|
||||
func (c *Client) GetStationTracks(ctx context.Context, stationID string, limit int) (*models.StationTracksResult, error) {
|
||||
params := map[string]string{}
|
||||
if limit > 0 {
|
||||
@@ -48,7 +47,7 @@ func (c *Client) GetStationTracks(ctx context.Context, stationID string, limit i
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetRotorStations gets rotor stations (generative)
|
||||
// GetRotorStations gets rotor stations (generative stations) (GET /rotor/stations).
|
||||
func (c *Client) GetRotorStations(ctx context.Context) ([]*models.RotorStation, error) {
|
||||
var result []models.RotorStation
|
||||
if err := c.request.Get(ctx, "/rotor/stations", nil, &result); err != nil {
|
||||
@@ -63,8 +62,7 @@ func (c *Client) GetRotorStations(ctx context.Context) ([]*models.RotorStation,
|
||||
return stations, nil
|
||||
}
|
||||
|
||||
// GetRotorStation gets a rotor station by ID
|
||||
// GET /rotor/station/{stationID}/info
|
||||
// GetRotorStation gets a rotor station by ID (GET /rotor/station/{stationID}/info).
|
||||
func (c *Client) GetRotorStation(ctx context.Context, stationID string) (*models.RotorStation, error) {
|
||||
var result models.RotorStation
|
||||
if err := c.request.Get(ctx, fmt.Sprintf("/rotor/station/%s/info", stationID), nil, &result); err != nil {
|
||||
@@ -74,8 +72,7 @@ func (c *Client) GetRotorStation(ctx context.Context, stationID string) (*models
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetRotorStationTracks gets tracks for a rotor station
|
||||
// GET /rotor/station/{stationID}/tracks
|
||||
// GetRotorStationTracks gets tracks for a rotor station (GET /rotor/station/{stationID}/tracks).
|
||||
func (c *Client) GetRotorStationTracks(ctx context.Context, stationID string, limit int) (*models.RotorStationTracksResult, error) {
|
||||
params := map[string]string{}
|
||||
if limit > 0 {
|
||||
@@ -89,8 +86,7 @@ func (c *Client) GetRotorStationTracks(ctx context.Context, stationID string, li
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// StartRotorSession starts a rotor session
|
||||
// POST /rotor/station/{stationID}/session/start
|
||||
// StartRotorSession starts a rotor session (POST /rotor/station/{stationID}/session/start).
|
||||
func (c *Client) StartRotorSession(ctx context.Context, stationID string) (*models.RotorSession, error) {
|
||||
var result models.RotorSession
|
||||
if err := c.request.Post(ctx, fmt.Sprintf("/rotor/station/%s/session/start", stationID), nil, &result); err != nil {
|
||||
@@ -100,8 +96,7 @@ func (c *Client) StartRotorSession(ctx context.Context, stationID string) (*mode
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// GetRotorSession gets rotor session info
|
||||
// GET /rotor/session?session_id={sessionID}
|
||||
// GetRotorSession gets rotor session info by session ID (GET /rotor/session).
|
||||
func (c *Client) GetRotorSession(ctx context.Context, sessionID string) (*models.RotorSession, error) {
|
||||
params := map[string]string{
|
||||
"session_id": sessionID,
|
||||
@@ -115,8 +110,8 @@ func (c *Client) GetRotorSession(ctx context.Context, sessionID string) (*models
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// RotorSessionFeedback sends feedback for a rotor session track
|
||||
// POST /rotor/station/{stationID}/feedback
|
||||
// RotorSessionFeedback sends feedback for a rotor session track (POST /rotor/station/{stationID}/feedback).
|
||||
// The feedbackType parameter can be "like", "dislike", or "skip".
|
||||
func (c *Client) RotorSessionFeedback(ctx context.Context, sessionID, trackID, feedbackType string) error {
|
||||
params := map[string]string{
|
||||
"track_id": trackID,
|
||||
|
||||
Reference in new issue
Block a user