Documentation
¶
Index ¶
- Constants
- Variables
- func DownloadTrackCover(dst io.Writer, track *Track, size int) (string, error)
- func ShareTrackLink(track *Track) string
- func Token(username, password string) (token string, err error)deprecated
- func TrackCoverLink(track *Track, size int) string
- type Album
- type Artist
- type ArtistTracks
- type BadRequestError
- type Cover
- type InvocInfo
- type Label
- type LikeTrackInfo
- type LikesDesc
- type LyricPair
- type Owner
- type Playlist
- type SearchResult
- type SearchSuggest
- type SearchType
- type Station
- type StationDesc
- type StationId
- type StationTracks
- type Tag
- type TimeLimitedReader
- type Track
- type TrackDownloadInfo
- type TrackLyrics
- type UnauthorizedError
- type UserStatus
- type YaMusicClient
- func (client *YaMusicClient) AddToPlaylist(kind uint64, revision, pos int, trackId string) (playlist Playlist, err error)
- func (client *YaMusicClient) Album(albumId uint64, withTracks bool) (album Album, err error)
- func (client *YaMusicClient) ArtistPopularTracks(artistId uint64) (tracks ArtistTracks, err error)
- func (client *YaMusicClient) ArtistTracks(artistId uint64, page, pageSize int) (tracks ArtistTracks, err error)
- func (client *YaMusicClient) CreatePlaylist(name string, public bool) (playlist Playlist, err error)
- func (client *YaMusicClient) DownloadTrack(dowInfo TrackDownloadInfo) (track io.ReadCloser, fileSize int64, err error)
- func (client *YaMusicClient) LikeTrack(trackId string) (err error)
- func (client *YaMusicClient) LikedTracks() (tracks []LikeTrackInfo, err error)
- func (client *YaMusicClient) ListPlaylists() (playlists []Playlist, err error)
- func (client *YaMusicClient) PlayTrack(track *Track, fromCache bool) (err error)
- func (client *YaMusicClient) Playlist(kind uint64) (playlist Playlist, err error)
- func (client *YaMusicClient) PlaylistTracks(kind uint64, userId uint64, mixed bool) (tracks []Track, err error)
- func (client *YaMusicClient) RemoveFromPlaylist(kind uint64, revision, pos int) (playlist Playlist, err error)
- func (client *YaMusicClient) RemovePlaylist(kind uint64) error
- func (client *YaMusicClient) RenamePlaylist(kind uint64, newName string) (playlist Playlist, err error)
- func (client *YaMusicClient) Search(request string, searchType SearchType) (results SearchResult, err error)
- func (client *YaMusicClient) SearchSuggest(part string) (suggestions SearchSuggest, err error)
- func (client *YaMusicClient) StationFeedback(feedType string, stationId StationId, batchId, trackId string, ...) (err error)
- func (client *YaMusicClient) StationTracks(id StationId, lastTrack *Track) (tracks StationTracks, err error)
- func (client *YaMusicClient) Stations(language string) (stations []StationDesc, err error)
- func (client *YaMusicClient) TrackDownloadInfo(trackId string) (dowInfos []TrackDownloadInfo, err error)
- func (client *YaMusicClient) TrackLyricsRequest(trackId string) (LRCLyrics []LyricPair, err error)
- func (client *YaMusicClient) Tracks(trackIds []string) (tracks []Track, err error)
- func (client *YaMusicClient) UnlikeTrack(trackId string) (err error)
Constants ¶
View Source
const ( ROTOR_RADIO_STARTED = "radioStarted" ROTOR_RADIO_FINISHED = "radioFinished" ROTOR_TRACK_STARTED = "trackStarted" ROTOR_TRACK_FINISHED = "trackFinished" ROTOR_SKIP = "skip" )
Rotor feedback types
View Source
const ( SEARCH_ARTIST = "artist" SEARCH_ALBUM = "album" SEARCH_TRACK = "track" SEARCH_ALL = "all" )
View Source
const (
YaMusicServerURL = "https://api.music.yandex.net/"
)
Yandex Music service information
Variables ¶
View Source
var (
MyWaveId = StationId{
Type: "user",
Tag: "onyourwave",
}
)
Functions ¶
func DownloadTrackCover ¶
func ShareTrackLink ¶
func TrackCoverLink ¶
Types ¶
type Album ¶
type Album struct {
Id uint64 `json:"id"`
Title string `json:"title"`
Available bool `json:"available"`
Type string `json:"type"`
MetaType string `json:"metaType"`
Year int `json:"year"`
ReleaseDate string `json:"releaseDate"`
CoverUri string `json:"coverUri"`
OgImage string `json:"ogImage"`
Genre string `json:"genre"`
Recent bool `json:"recent"`
TrackCount int `json:"trackCount"`
Volumes [][]Track `json:"volumes"`
Artists []Artist `json:"artists"`
Labels []Label `json:"labels"`
}
type ArtistTracks ¶
type BadRequestError ¶
func (BadRequestError) Error ¶
func (e BadRequestError) Error() string
type LikeTrackInfo ¶
type LikesDesc ¶
type LikesDesc struct {
Library struct {
Uid uint64 `json:"uid"`
Revisions int `json:"revisions"`
Tracks []LikeTrackInfo `json:"tracks"`
} `json:"library"`
}
type Playlist ¶
type Playlist struct {
Uid uint64 `json:"uid"`
Kind uint64 `json:"kind"`
Title string `json:"title"`
Description string `json:"description"`
DescriptionFormatted string `json:"descriptionFormatted"`
Available bool `json:"available"`
Collective bool `json:"collective"`
Created string `json:"created"`
Modified string `json:"modified"`
Visibility string `json:"visibility"`
LikesCount int `json:"likesCount"`
Revision int `json:"revision"`
Tags []Tag `json:"tags"`
Owner Owner `json:"owner"`
Cover Cover `json:"cover"`
OgImage string `json:"ogImage"`
BackgroundColor string `json:"backgroundColor"`
TextColor string `json:"textColor"`
TrackCount int `json:"trackCount"`
Tracks []struct {
Id uint64 `json:"id"`
PlayCount int `json:"playCount"`
Recent bool `json:"recent"`
Timestamp string `json:"timestamp"`
Track Track `json:"track"`
} `json:"tracks"`
}
type SearchResult ¶
type SearchResult struct {
SearchResultId string `json:"searchResultId"`
Text string `json:"text"`
Best struct {
Type string `json:"type"`
Text string `json:"text"`
Result Track `json:"result"`
} `json:"best"`
Albums struct {
Type string `json:"type"`
Total int `json:"total"`
PerPage int `json:"perPage"`
Order int `json:"order"`
Results []Album `json:"results"`
} `json:"albums"`
Artists struct {
Type string `json:"type"`
Total int `json:"total"`
PerPage int `json:"perPage"`
Order int `json:"order"`
Results []Artist `json:"results"`
} `json:"artists"`
Playlists struct {
Type string `json:"type"`
Total int `json:"total"`
PerPage int `json:"perPage"`
Order int `json:"order"`
Results []Playlist `json:"results"`
} `json:"playlists"`
Tracks struct {
Type string `json:"type"`
Total int `json:"total"`
PerPage int `json:"perPage"`
Order int `json:"order"`
Results []Track `json:"results"`
} `json:"tracks"`
Type string `json:"type"`
Page int `json:"page"`
PerPage int `json:"perPage"`
MisspellCorrected bool `json:"misspellCorrected"`
MisspellOriginal string `json:"misspellOriginal"`
Nocorrect bool `json:"nocorrect"`
}
type SearchSuggest ¶
type SearchType ¶
type SearchType string
type Station ¶
type Station struct {
Id StationId `json:"id"`
Name string `json:"name"`
Icon struct {
BackgroundColor string `json:"backgroundIcon"`
ImageUrl string `json:"imageUrl"`
} `json:"icon"`
FullImageUrl string `json:"fullImageUrl"`
Restrictions struct {
Language struct {
Type string `json:"type"`
Name string `json:"name"`
PossibleValues struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"possibleValues"`
} `json:"language"`
Mood struct {
Type string `json:"type"`
Name string `json:"name"`
Min struct {
Name string `json:"name"`
Value float32 `json:"value"`
} `json:"min"`
Max struct {
Name string `json:"name"`
Value float32 `json:"value"`
} `json:"max"`
} `json:"mood"`
Energy struct {
Type string `json:"type"`
Name string `json:"name"`
Min struct {
Name string `json:"name"`
Value float32 `json:"value"`
} `json:"min"`
Max struct {
Name string `json:"name"`
Value float32 `json:"value"`
} `json:"max"`
} `json:"energy"`
Diversity struct {
Type string `json:"type"`
Name string `json:"name"`
PossibleValues struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"possibleValues"`
} `json:"diversity"`
} `json:"restrictions"`
}
type StationDesc ¶
type StationDesc struct {
Station Station `json:"station"`
Settings struct {
Language string `json:"language"`
Diversity string `json:"diversity"`
Mood float32 `json:"mood"`
Energy float32 `json:"energy"`
} `json:"settings"`
RupTitle string `json:"rupTitle"`
RupDescription string `json:"rupDescription"`
}
type StationTracks ¶
type TimeLimitedReader ¶
type TimeLimitedReader struct {
// contains filtered or unexported fields
}
func NewTimeLimitedReader ¶
func NewTimeLimitedReader(r io.ReadCloser, ctx context.Context, ctxCancel context.CancelFunc, timeout time.Duration) *TimeLimitedReader
func (*TimeLimitedReader) Close ¶
func (r *TimeLimitedReader) Close() error
type Track ¶
type Track struct {
Id string `json:"id"`
RealId string `json:"realId"`
Title string `json:"title"`
Version string `json:"version"`
Available bool `json:"available"`
Type string `json:"type"`
CoverUri string `json:"coverUri"`
OgImage string `json:"ogImage"`
LyricsAvailable bool `json:"lyricsAvailable"`
LyricsInfo struct {
HasAvailableSyncLyrics bool `json:"hasAvailableSyncLyrics"`
HasAvailableTextLyrics bool `json:"hasAvailableTextLyrics"`
} `json:"lyricsInfo"`
Normalization struct {
Gain float32 `json:"gain"`
Peak float32 `json:"Peak"`
} `json:"normalization"`
Fade struct {
InStart float32 `json:"inStart"`
InStop float32 `json:"inStop"`
OutStart float32 `json:"outStart"`
OutStop float32 `json:"outStop"`
} `json:"fade"`
Major struct {
Id int `json:"id"`
Name string `json:"name"`
} `json:"major"`
Artists []Artist `json:"artists"`
Albums []Album `json:"albums"`
FileSize int `json:"fileSize"`
StorageDir string `json:"storageDir"`
DurationMs int `json:"durationMs"`
RememberPosition bool `json:"rememberPosition"`
}
type TrackDownloadInfo ¶
type TrackLyrics ¶
type UnauthorizedError ¶
type UnauthorizedError struct {
}
func (UnauthorizedError) Error ¶
func (e UnauthorizedError) Error() string
type UserStatus ¶
type UserStatus struct {
Account struct {
Uid uint64 `json:"uid"`
DisplayName string `json:"displayName"`
FirstName string `json:"firstName"`
SecondName string `json:"secondName"`
FullName string `json:"fullName"`
Login string `json:"login"`
ServiceAvailable bool `json:"serviceAvailable"`
} `json:"account"`
Permissions struct {
Until string `json:"until"`
Values []string `json:"values"`
} `json:"permissions"`
Plus struct {
HasPlus bool `json:"hasPlus"`
IsTutorialCompleted bool `json:"isTutorialCompleted"`
} `json:"plus"`
}
type YaMusicClient ¶
type YaMusicClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(name, token string) (*YaMusicClient, error)
func (*YaMusicClient) AddToPlaylist ¶
func (*YaMusicClient) Album ¶
func (client *YaMusicClient) Album(albumId uint64, withTracks bool) (album Album, err error)
func (*YaMusicClient) ArtistPopularTracks ¶
func (client *YaMusicClient) ArtistPopularTracks(artistId uint64) (tracks ArtistTracks, err error)
func (*YaMusicClient) ArtistTracks ¶
func (client *YaMusicClient) ArtistTracks(artistId uint64, page, pageSize int) (tracks ArtistTracks, err error)
func (*YaMusicClient) CreatePlaylist ¶
func (client *YaMusicClient) CreatePlaylist(name string, public bool) (playlist Playlist, err error)
func (*YaMusicClient) DownloadTrack ¶
func (client *YaMusicClient) DownloadTrack(dowInfo TrackDownloadInfo) (track io.ReadCloser, fileSize int64, err error)
func (*YaMusicClient) LikeTrack ¶
func (client *YaMusicClient) LikeTrack(trackId string) (err error)
func (*YaMusicClient) LikedTracks ¶
func (client *YaMusicClient) LikedTracks() (tracks []LikeTrackInfo, err error)
func (*YaMusicClient) ListPlaylists ¶
func (client *YaMusicClient) ListPlaylists() (playlists []Playlist, err error)
func (*YaMusicClient) PlayTrack ¶
func (client *YaMusicClient) PlayTrack(track *Track, fromCache bool) (err error)
func (*YaMusicClient) Playlist ¶
func (client *YaMusicClient) Playlist(kind uint64) (playlist Playlist, err error)
func (*YaMusicClient) PlaylistTracks ¶
func (*YaMusicClient) RemoveFromPlaylist ¶
func (client *YaMusicClient) RemoveFromPlaylist(kind uint64, revision, pos int) (playlist Playlist, err error)
func (*YaMusicClient) RemovePlaylist ¶
func (client *YaMusicClient) RemovePlaylist(kind uint64) error
func (*YaMusicClient) RenamePlaylist ¶
func (client *YaMusicClient) RenamePlaylist(kind uint64, newName string) (playlist Playlist, err error)
func (*YaMusicClient) Search ¶
func (client *YaMusicClient) Search(request string, searchType SearchType) (results SearchResult, err error)
func (*YaMusicClient) SearchSuggest ¶
func (client *YaMusicClient) SearchSuggest(part string) (suggestions SearchSuggest, err error)
func (*YaMusicClient) StationFeedback ¶
func (*YaMusicClient) StationTracks ¶
func (client *YaMusicClient) StationTracks(id StationId, lastTrack *Track) (tracks StationTracks, err error)
func (*YaMusicClient) Stations ¶
func (client *YaMusicClient) Stations(language string) (stations []StationDesc, err error)
func (*YaMusicClient) TrackDownloadInfo ¶
func (client *YaMusicClient) TrackDownloadInfo(trackId string) (dowInfos []TrackDownloadInfo, err error)
func (*YaMusicClient) TrackLyricsRequest ¶
func (client *YaMusicClient) TrackLyricsRequest(trackId string) (LRCLyrics []LyricPair, err error)
func (*YaMusicClient) Tracks ¶
func (client *YaMusicClient) Tracks(trackIds []string) (tracks []Track, err error)
func (*YaMusicClient) UnlikeTrack ¶
func (client *YaMusicClient) UnlikeTrack(trackId string) (err error)
Click to show internal directories.
Click to hide internal directories.