Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToheaderMap ¶
func DefaultHeaderUserAgent ¶
func DefaultHeaderUserAgent()
func RmHeaderMap ¶
func RmHeaderMap(k string)
Types ¶
type Lyric ¶
type Lyric struct {
// contains filtered or unexported fields
}
Lyric API.
func New ¶
New creates a new Lyric API, which can be used to Search for Lyrics using various providers. The default behaviour is to use all providers available, although it can be explicitly set to the same using, eg.
lyrics.New(WithAllProviders())
In case your usecase requires using only specific providers, you can provide New() with WithoutProviders() followed by the specific WithXXXXProvider() as an optional parameter.
Note: The providers are processed one by one so custom providers, can also be used to set the priority for your usecase.
Eg. to attempt only with Lyrics Wikia:
lyrics.New(WithoutProviders(), WithLyricsWikia())
Eg. to attempt with both Lyrics Wikia and Song Lyrics:
lyrics.New(WithoutProviders(), WithLyricsWikia(), WithSongLyrics())
type Option ¶
Option type describes Option Configuration Decorator return type.
func WithAllProviders ¶
func WithAllProviders() Option
WithAllProviders is an Option Configuration Decorator that sets Lyric to attempt fetching lyrics using all providers that do not require setup.
func WithGeniusLyrics ¶
WithGeniusLyrics is an Option Configuration Decorator that adds Genius Provider to the list of providers to attempt fetching lyrics from. It requires an additional access token which can be obtained using the developer portal (https://genius.com/developers)
func WithLyricsWikia ¶
func WithLyricsWikia() Option
WithLyricsWikia is an Option Configuration Decorator that adds Lyrics Wikia Provider to the list of providers to attempt fetching lyrics from.
func WithMusixMatch ¶
func WithMusixMatch() Option
WithMusixMatch is an Option Configuration Decorator that adds Musixmatch Provider to the list of providers to attempt fetching lyrics from.
func WithSongLyrics ¶
func WithSongLyrics() Option
WithSongLyrics is an Option Configuration Decorator that adds Song Lyrics Provider to the list of providers to attempt fetching lyrics from.
func WithoutProviders ¶
func WithoutProviders() Option
WithoutProviders is an Option Configuration Decorator that removes all providers from the list of providers to attempt fetching lyrics from. It can be used to remove the default providers and set a custom provider list.