Documentation
¶
Overview ¶
Package lyrics proxies the public LrcLib API (https://lrclib.net) from the backend, mirroring how tmdb/subtitles/imagesearch call external services server-side. Doing it here (not from the browser) lets us:
- send a proper identifying User-Agent (LrcLib etiquette) WITHOUT tripping a CORS preflight the browser can't satisfy;
- cache results so repeated views don't re-hit the public API;
- shield each client's IP from LrcLib's per-IP rate limiting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a cached LrcLib proxy. The zero value is not usable — call New.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, artist, title, album string, durationSec int) (Lyrics, error)
Get resolves lyrics for a track. It tries the exact /api/get first, then falls back to /api/search. Results (including "not found") are cached for cacheTTL. A nil error with an empty Source means "no lyrics found".
Click to show internal directories.
Click to hide internal directories.