Documentation ¶
Overview ¶
Package glyrics provides tools for extracting lyrics.
Index ¶
- func Search(ctx context.Context, searcher search.Searcher, query string) <-chan *LyricsInfo
- func WithWorkers(ctx context.Context, workers int64) context.Context
- type LyricsInfo
- func Extract(url string) (*LyricsInfo, error)
- func ExtractFromRequest(req *request.Request) (*LyricsInfo, error)
- func ExtractWithContext(ctx context.Context, url string) (*LyricsInfo, error)
- func SearchFirst(ctx context.Context, searcher search.Searcher, query string) *LyricsInfo
- func SearchN(ctx context.Context, searcher search.Searcher, query string, amount int) []LyricsInfo
- type LyricsOrigin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LyricsInfo ¶
LyricsInfo is an alias for lyrics.Info
func Extract ¶ added in v3.1.0
func Extract(url string) (*LyricsInfo, error)
Extract wraps the provided url in a Request and performs ExtractFromRequest.
func ExtractFromRequest ¶ added in v3.1.0
func ExtractFromRequest(req *request.Request) (*LyricsInfo, error)
ExtractFromRequest tries to extract lyrics from the provided Request. Errors from extracting lyrics are ignored. The only error returned by this function is when no extractor was able to extract any lyrics.
func ExtractWithContext ¶ added in v3.1.0
func ExtractWithContext(ctx context.Context, url string) (*LyricsInfo, error)
ExtractWithContext extracts the lyrics from the url using the context.
func SearchFirst ¶ added in v3.1.0
SearchFirst returns the first search result from the searcher for the query. Might return nil if the context is cancelled or no results are found.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pkg
|
|
lyrics
Package lyrics provides the lyrics information and origin models.
|
Package lyrics provides the lyrics information and origin models. |
request
Package request provides a request object for accessing websites.
|
Package request provides a request object for accessing websites. |
search
Package search provides search engines using a common interface.
|
Package search provides search engines using a common interface. |
sources
Package sources contains the extractors for gLyrics.
|
Package sources contains the extractors for gLyrics. |
Click to show internal directories.
Click to hide internal directories.