Documentation ¶
Index ¶
- type API
- func (a *API) GetAlbum(ctx context.Context, albumId string) (*api.Collection, error)
- func (a *API) GetAlbumRaw(ctx context.Context, albumId string, page int, pageSize int) (*AlbumResponse, error)
- func (a *API) GetArtist(ctx context.Context, artistId string) (*api.Collection, error)
- func (a *API) GetArtistInfoRaw(ctx context.Context, artistId string) (*ArtistInfoResponse, error)
- func (a *API) GetArtistSongsRaw(ctx context.Context, artistId string, page int, pageSize int) (*ArtistSongsResponse, error)
- func (a *API) GetPlaylist(ctx context.Context, playlistId string) (*api.Collection, error)
- func (a *API) GetPlaylistRaw(ctx context.Context, playlistId string, page int, pageSize int) (*PlaylistResponse, error)
- func (a *API) GetSong(ctx context.Context, mid string) (*api.Song, error)
- func (a *API) GetSongLyric(ctx context.Context, mid int) (string, error)
- func (a *API) GetSongLyricRaw(ctx context.Context, mid int) (*SongLyricResponse, error)
- func (a *API) GetSongRaw(ctx context.Context, mid string) (*SongResponse, error)
- func (a *API) GetSongURL(ctx context.Context, mid int, br int) (string, error)
- func (a *API) GetSongURLRaw(ctx context.Context, mid int, br int) (*SongURLResponse, error)
- func (a *API) SearchSongs(ctx context.Context, keyword string) ([]*api.Song, error)
- func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)
- func (a *API) SendRequest(req *ghttp.Request) (*ghttp.Response, error)
- type AlbumResponse
- type ArtistInfo
- type ArtistInfoResponse
- type ArtistSongsResponse
- type CommonResponse
- type PlaylistResponse
- type SearchSongsResponse
- type Song
- type SongLyricResponse
- type SongResponse
- type SongURLResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) GetAlbumRaw ¶
func (a *API) GetAlbumRaw(ctx context.Context, albumId string, page int, pageSize int) (*AlbumResponse, error)
获取专辑,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetArtistInfoRaw ¶
获取歌手信息
func (*API) GetArtistSongsRaw ¶
func (a *API) GetArtistSongsRaw(ctx context.Context, artistId string, page int, pageSize int) (*ArtistSongsResponse, error)
获取歌手歌曲,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetPlaylist ¶
func (*API) GetPlaylistRaw ¶
func (a *API) GetPlaylistRaw(ctx context.Context, playlistId string, page int, pageSize int) (*PlaylistResponse, error)
获取歌单,page: 页码; pageSize: 每页数量,如果要获取全部请设置为较大的值
func (*API) GetSongLyricRaw ¶
获取歌词
func (*API) GetSongRaw ¶
获取歌曲详情
func (*API) GetSongURL ¶
func (*API) GetSongURLRaw ¶
获取歌曲播放地址,br: 比特率,128/192/320 可选
func (*API) SearchSongs ¶
func (*API) SearchSongsRaw ¶
func (a *API) SearchSongsRaw(ctx context.Context, keyword string, page int, pageSize int) (*SearchSongsResponse, error)
搜索歌曲
type AlbumResponse ¶
type AlbumResponse struct { CommonResponse Data struct { AlbumId int `json:"albumId"` Album string `json:"album"` Pic string `json:"pic"` MusicList []*Song `json:"musicList"` } `json:"data"` }
func (*AlbumResponse) String ¶
func (a *AlbumResponse) String() string
type ArtistInfo ¶
type ArtistInfoResponse ¶
type ArtistInfoResponse struct { CommonResponse Data ArtistInfo `json:"data"` }
func (*ArtistInfoResponse) String ¶
func (a *ArtistInfoResponse) String() string
type ArtistSongsResponse ¶
type ArtistSongsResponse struct { CommonResponse Data struct { List []*Song `json:"list"` } `json:"data"` }
func (*ArtistSongsResponse) String ¶
func (a *ArtistSongsResponse) String() string
type CommonResponse ¶
type PlaylistResponse ¶
type PlaylistResponse struct { CommonResponse Data struct { Id int `json:"id"` Name string `json:"name"` Img700 string `json:"img700"` MusicList []*Song `json:"musicList"` } `json:"data"` }
func (*PlaylistResponse) String ¶
func (p *PlaylistResponse) String() string
type SearchSongsResponse ¶
type SearchSongsResponse struct { CommonResponse Data struct { Total string `json:"total"` List []*Song `json:"list"` } `json:"data"` }
func (*SearchSongsResponse) String ¶
func (s *SearchSongsResponse) String() string
type Song ¶
type Song struct { RId int `json:"rid"` Name string `json:"name"` ArtistId int `json:"artistid"` Artist string `json:"artist"` AlbumId int `json:"albumid"` Album string `json:"album"` AlbumPic string `json:"albumpic"` Track int `json:"track"` IsListenFee bool `json:"isListenFee"` SongTimeMinutes string `json:"songTimeMinutes"` Lyric string `json:"-"` URL string `json:"-"` }
type SongLyricResponse ¶
type SongLyricResponse struct { Status int `json:"status"` Msg string `json:"msg,omitempty"` Data struct { LrcList []struct { Time string `json:"time"` LineLyric string `json:"lineLyric"` } `json:"lrclist"` } `json:"data"` }
func (*SongLyricResponse) String ¶
func (s *SongLyricResponse) String() string
type SongResponse ¶
type SongResponse struct { CommonResponse Data Song `json:"data"` }
func (*SongResponse) String ¶
func (s *SongResponse) String() string
type SongURLResponse ¶
type SongURLResponse struct { CommonResponse URL string `json:"url"` }
func (*SongURLResponse) String ¶
func (s *SongURLResponse) String() string
Click to show internal directories.
Click to hide internal directories.