music

package
v0.0.0-...-b32e05d Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsExists   = errors.New("server is exists")
	ErrNotFound   = errors.New("server is not found")
	ErrNotSupport = errors.New("server is not support")
)

Functions

This section is empty.

Types

type Album

type Album struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Songs Songs  `json:"songs"`
}

type Artist

type Artist struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Songs Songs  `json:"songs"`
}

type Lyric

type Lyric struct {
	Lyric string `json:"lyric"`
	Trans string `json:"trans"`
}

type Music

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

func (*Music) Album

func (m *Music) Album(server string, id string) (*Album, error)

func (*Music) Artist

func (m *Music) Artist(server string, id string) (*Artist, error)

func (*Music) Lyric

func (m *Music) Lyric(server string, id string) (*Lyric, error)

func (*Music) Playlist

func (m *Music) Playlist(server string, id string) (*Playlist, error)

func (*Music) Search

func (m *Music) Search(server string, id string) ([]*Song, error)

func (*Music) Song

func (m *Music) Song(server string, id string) (*Song, error)
func (m *Music) SongLink(server string, id string) (*SongLink, error)

type Playlist

type Playlist struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Songs Songs  `json:"songs"`
}

type Server

type Server interface {
	Search(string) ([]*Song, error)
	Song(string) (*Song, error)
	SongLink(string) (*SongLink, error)
	Lyric(string) (*Lyric, error)
	Album(string) (*Album, error)
	Artist(string) (*Artist, error)
	Playlist(string) (*Playlist, error)
}

type Song

type Song struct {
	Id      string    `json:"id"`
	Name    string    `json:"name"`
	Picture string    `json:"picture"`
	Artist  []*Artist `json:"artist"`
	Album   *Album    `json:"album"`
}

func (*Song) GetArtist

func (s *Song) GetArtist() string
type SongLink struct {
	Id   string `json:"id"`
	Br   int64  `json:"br"`
	Size int64  `json:"size"`
	URL  string `json:"url"`
}

type Songs

type Songs []*Song

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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