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
+12
-6
@@ -1,3 +1,4 @@
|
||||
// Package utils provides utility functions for the Yandex Music API client.
|
||||
package utils
|
||||
|
||||
import (
|
||||
@@ -10,21 +11,23 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultSignKey is the signing key from the Android app
|
||||
// DefaultSignKey is the signing key from the Android app.
|
||||
DefaultSignKey = "p93jhgh689SBReK6ghtw62"
|
||||
// DesktopSignKey is the signing key from the desktop app
|
||||
// DesktopSignKey is the signing key from the desktop app.
|
||||
DesktopSignKey = "kzqU4XhfCaY6B6JTHODeq5"
|
||||
// DesktopClient is the X-Yandex-Music-Client header value for desktop
|
||||
// DesktopClient is the X-Yandex-Music-Client header value for desktop.
|
||||
DesktopClient = "YandexMusicDesktopAppWindows/5.95.0"
|
||||
)
|
||||
|
||||
// Sign represents a request signature
|
||||
// Sign represents a request signature for signed API requests.
|
||||
type Sign struct {
|
||||
Timestamp int64
|
||||
Value string
|
||||
}
|
||||
|
||||
// GetSignRequest creates a signature for a track request
|
||||
// GetSignRequest creates a signature for a track request using HMAC-SHA256.
|
||||
// It returns a Sign with the timestamp and base64-encoded signature value.
|
||||
// If key is empty, DefaultSignKey is used.
|
||||
func GetSignRequest(trackID string, key string) Sign {
|
||||
if key == "" {
|
||||
key = DefaultSignKey
|
||||
@@ -43,7 +46,9 @@ func GetSignRequest(trackID string, key string) Sign {
|
||||
}
|
||||
}
|
||||
|
||||
// GetFileInfoSign creates a signature for file info requests
|
||||
// GetFileInfoSign creates a signature for file info requests using HMAC-SHA256.
|
||||
// It returns a Sign with the timestamp and base64-encoded signature value (last character removed as in Python).
|
||||
// If key is empty, DesktopSignKey is used.
|
||||
func GetFileInfoSign(trackID, quality string, codecs []string, transport, key string) Sign {
|
||||
if key == "" {
|
||||
key = DesktopSignKey
|
||||
@@ -66,6 +71,7 @@ func GetFileInfoSign(trackID, quality string, codecs []string, transport, key st
|
||||
}
|
||||
}
|
||||
|
||||
// joinCodecs joins a list of codec strings into a single string.
|
||||
func joinCodecs(codecs []string) string {
|
||||
result := ""
|
||||
for _, c := range codecs {
|
||||
|
||||
Reference in new issue
Block a user