lyrics

package
v0.0.0-...-619a326 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLyrics

func GetLyrics(name string) (text string, err error)

Types

type AskTrackQuery

type AskTrackQuery struct {
	Name       *[]string `json:"name"`
	AlName     *[]string `json:"alname"`
	CircleName *[]string `json:"circlename"`
	Cover      *[]string `json:"cover2x"`
	Lyrics     *[]string `json:"lyrics"`
}

type AskTrackResponse

type AskTrackResponse struct {
	Results    []AskTrackResponseResult `json:"results"`
	Error      string                   `json:"error,omitempty"`
	HTTPCode   int                      `json:"httpCode,omitempty"`
	HTTPReason string                   `json:"httpReason,omitempty"`
}

func (*AskTrackResponse) AddMeta

func (r *AskTrackResponse) AddMeta(request *Request, document *lrc.Document) (err error)

func (*AskTrackResponse) FromRequest

func (r *AskTrackResponse) FromRequest(request *Request) (err error)

type AskTrackResponseResult

type AskTrackResponseResult struct {
	ID         string                        `json:"id"`
	Name       []string                      `json:"name"`
	AlName     []string                      `json:"alname"`
	CircleName []string                      `json:"circlename"`
	Cover      []AskTrackResponseResultCover `json:"cover2x"`
}

type AskTrackResponseResultCover

type AskTrackResponseResultCover struct {
	FullText     string `json:"fulltext"`
	FullUrl      string `json:"fullurl"`
	Namespace    int    `json:"namespace"`
	Exists       bool   `json:"exists"`
	Displaytitle string `json:"displaytitle"`
}

type InvalidLanguageError

type InvalidLanguageError struct {
	Text string
}

func (*InvalidLanguageError) Error

func (e *InvalidLanguageError) Error() string

type Language

type Language string
const (
	LANGUAGE_ALL Language = "all"
	LANGUAGE_ZH  Language = "zh"
	LANGUAGE_JA  Language = "ja"
)

func ParseLanguage

func ParseLanguage(text string) (Language, error)

func (Language) String

func (language Language) String() string

type Request

type Request struct {
	Title     string   `json:"title"`
	Index     int      `json:"index"`
	Language  Language `json:"language"`
	Extension string   `json:"extension"`
}

func (*Request) FromName

func (request *Request) FromName(name string) (err error)

func (*Request) GetLrc

func (request *Request) GetLrc() (string, error)

func (*Request) String

func (request *Request) String() string

type TTTResponse

type TTTResponse struct {
	Title string            `json:"title,omitempty"`
	Table []*TTTResponseRow `json:"table,omitempty"`
	Error *TTTResponseError `json:"error,omitempty"`
}

func (*TTTResponse) AddLines

func (r *TTTResponse) AddLines(request *Request, document *lrc.Document) (err error)

func (*TTTResponse) FromRequest

func (r *TTTResponse) FromRequest(request *Request) (err error)

type TTTResponseCell

type TTTResponseCell struct {
	Lang    string `json:"lang"`
	Content string `json:"*"`
}

type TTTResponseError

type TTTResponseError struct {
	Code    string `json:"code"`
	Info    string `json:"info"`
	Content string `json:"*"`
}

type TTTResponseRow

type TTTResponseRow struct {
	Type  string           `json:"type"`
	Index int64            `json:"index"`
	Cell0 *TTTResponseCell `json:"0,omitempty"`
	Cell1 *TTTResponseCell `json:"1,omitempty"`
	Cell2 *TTTResponseCell `json:"2,omitempty"`
}

func (*TTTResponseRow) FindLang

func (row *TTTResponseRow) FindLang(lang string) string

Jump to

Keyboard shortcuts

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