Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorExternalApi = errors.New("miaosic: external api error") ErrorNoSuchProvider = errors.New("miaosic: no such provider") ErrorDifferentProvider = errors.New("miaosic: different provider") ErrorInvalidPageSetting = errors.New("miaosic: invalid page setting") ErrorInvalidMediaMeta = errors.New("miaosic: invalid media meta") )
View Source
var ErrNotImplemented = errors.New("miaosic: not implemented")
View Source
var Requester dphttp.IRequester = deepcolor.NewRestyRequester()
Functions ¶
func ListAvailableProviders ¶
func ListAvailableProviders() []string
func RegisterProvider ¶
func RegisterProvider(provider MediaProvider)
Types ¶
type Loginable ¶
type Loginable interface { Login(username string, password string) error Logout() error IsLogin() bool QrLogin() (*QrLoginSession, error) QrLoginVerify(qrlogin *QrLoginSession) (*QrLoginResult, error) RestoreSession(session string) error SaveSession() string }
type LyricContext ¶ added in v0.1.6
type Lyrics ¶
func GetMediaLyric ¶ added in v0.1.6
func ParseLyrics ¶
func (*Lyrics) FindContext ¶ added in v0.1.6
func (l *Lyrics) FindContext(time float64, prev int, next int) *LyricContext
type MediaInfo ¶
func GetMediaInfo ¶ added in v0.1.6
type MediaProvider ¶
type MediaProvider interface { // GetName returns the name of the provider. GetName() string // Search returns a list of MetaData. Search(keyword string, page, size int) ([]MediaInfo, error) // MatchMedia returns a MetaData if the uri is matched, otherwise nil. MatchMedia(uri string) (MetaData, bool) GetMediaInfo(meta MetaData) (MediaInfo, error) GetMediaUrl(meta MetaData, quality Quality) ([]MediaUrl, error) GetMediaLyric(meta MetaData) ([]Lyrics, error) // MatchPlaylist returns a MetaData if the uri is matched, otherwise nil. MatchPlaylist(uri string) (MetaData, bool) // GetPlaylist returns a Playlist, it fetches all data, so it might be slow. GetPlaylist(meta MetaData) (*Playlist, error) }
func GetProvider ¶
func GetProvider(name string) (MediaProvider, bool)
type MetaData ¶ added in v0.1.5
func MatchPlaylistByProvider ¶ added in v0.1.6
func NewMetaData ¶ added in v0.1.5
type Playlist ¶ added in v0.1.5
func GetPlaylist ¶ added in v0.1.6
func (*Playlist) DisplayName ¶ added in v0.1.6
type QrLoginResult ¶ added in v0.1.5
type QrLoginSession ¶ added in v0.1.5
Click to show internal directories.
Click to hide internal directories.