client

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GeniusClientId     string
	GeniusClientSecret string
	Providers          []provider.Name
	// ApiAddress only used by [Http] client, setting its value for [Local] client won't destroy the world, but it's pointless.
	// defaults to (https://api.danklyrics.com)
	ApiAddress string
}

Config holds the configs needed to initialize Local or Http clients.

type Http

type Http struct {
	// contains filtered or unexported fields
}

Http is the dank lyrics finding client that makes a call to api.danklyrics.com to find the lyrics.

func NewHttp

func NewHttp(c Config) (*Http, error)

func (*Http) GetSongLyrics

func (c *Http) GetSongLyrics(s provider.SearchParams) (models.Lyrics, error)

GetSongLyrics search for song's lyrics using the enabled providers list, where using a provider depends on the provider's order in that list.

returns [Lyrics] and an occurring [error]

type Local

type Local struct {
	// contains filtered or unexported fields
}

Local is the dank lyrics finding client that uses finder.Service to find lyrics using the enabled providers.

func New

func New(c Config) (*Local, error)

New initializes a new Local instance with the given configs.

func (*Local) GetSongLyrics

func (c *Local) GetSongLyrics(s provider.SearchParams) (models.Lyrics, error)

GetSongLyrics search for song's lyrics using the enabled providers list, where using a provider depends on the provider's order in that list.

returns [Lyrics] and an occurring [error]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL