- 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>
29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
// Package models provides data models for the Yandex Music API.
|
|
package models
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// ClientInterface defines the minimal client interface needed by models.
|
|
// Models use this to access the underlying request handler.
|
|
type ClientInterface interface {
|
|
// GetRequest returns the underlying request handler.
|
|
GetRequest() RequestInterface
|
|
}
|
|
|
|
// RequestInterface defines the minimal request interface needed by models.
|
|
// It provides methods for making HTTP requests to the Yandex Music API.
|
|
type RequestInterface interface {
|
|
// Get performs a GET request to the given path with query parameters.
|
|
Get(ctx context.Context, path string, params map[string]string, result any) error
|
|
// Post performs a POST request to the given path with a JSON body.
|
|
Post(ctx context.Context, path string, body any, result any) error
|
|
// Put performs a PUT request to the given path with a JSON body.
|
|
Put(ctx context.Context, path string, body any, result any) error
|
|
// Delete performs a DELETE request to the given path with an optional JSON body.
|
|
Delete(ctx context.Context, path string, body any, result any) error
|
|
// Download downloads a file from the given URL and returns the raw response body.
|
|
Download(ctx context.Context, url string) ([]byte, error)
|
|
}
|