Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Search *SearchService
Songs *SongsService
}
Client is the lrclibgo client that handles all the different API calls to lrclib.net/api
type ErrApiError ¶
func (*ErrApiError) Error ¶
func (e *ErrApiError) Error() string
type ErrInvalidParams ¶
type ErrInvalidParams struct {
ParamName string
}
func (*ErrInvalidParams) Error ¶
func (e *ErrInvalidParams) Error() string
type ErrNotFound ¶
type ErrNotFound struct{}
func (*ErrNotFound) Error ¶
func (e *ErrNotFound) Error() string
type GetSongParams ¶
type GetSongParams struct {
// TrackName is the title of the track.
TrackName string
// ArtistName is the name of the artist who performed the track.
ArtistName string
// AlbumName is the name of the album to which the track belongs.
AlbumName string
// Duration is the track's duration in seconds.
Duration int `json:"duration"`
}
func (GetSongParams) UrlParams ¶
func (p GetSongParams) UrlParams() url.Values
func (GetSongParams) Validate ¶
func (p GetSongParams) Validate() error
type Lyrics ¶
type Lyrics struct {
// contains filtered or unexported fields
}
Lyrics holds the actual plain text value of the lyrics.
type SearchParams ¶
type SearchParams struct {
// Query searches for keywords present in any of the track's title,
// artist name, or album name fields.
Query string
// TrackName searches for keywords specifically within the track's title.
TrackName string
// ArtistName searches for keywords specifically within the track's artist name.
ArtistName string
// AlbumName searches for keywords specifically within the track's album name.
AlbumName string
// Limit limits the search results count.
Limit int
}
SearchParams represents parameters for searching music tracks. It allows for general keyword search or specific searches within track title, artist name, or album name.
func (SearchParams) UrlParams ¶
func (p SearchParams) UrlParams() url.Values
func (SearchParams) Validate ¶
func (p SearchParams) Validate() error
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
func (*SearchService) Get ¶
func (s *SearchService) Get(params SearchParams) ([]Song, error)
type Song ¶
type Song struct {
ID int `json:"id"`
Name string `json:"name"`
TrackName string `json:"trackName"`
ArtistName string `json:"artistName"`
AlbumName string `json:"albumName"`
Duration float32 `json:"duration"`
Instrumental bool `json:"instrumental"`
PlainLyrics string `json:"plainLyrics"`
SyncedLyrics string `json:"syncedLyrics"`
// contains filtered or unexported fields
}
Song represents how a song looks like coming from lrclib.net/api
type SongsService ¶
type SongsService struct {
// contains filtered or unexported fields
}
func (*SongsService) GetByParams ¶
func (s *SongsService) GetByParams(params GetSongParams) (Song, error)
Click to show internal directories.
Click to hide internal directories.
