Documentation ¶
Index ¶
- Constants
- Variables
- type Album
- type AlbumList
- type AlbumTrackData
- type Artist
- type ArtistAlbumData
- type AuthData
- type Box
- func (b *Box) FetchAlbum(id string) (*Album, error)
- func (b *Box) FetchAlbumTrack(id string, params ...Param) (*AlbumTrackData, error)
- func (b *Box) FetchArtist(id string) (*Artist, error)
- func (b *Box) FetchArtistAlbum(id string, params ...Param) (*ArtistAlbumData, error)
- func (b *Box) FetchArtistRelated(id string, params ...Param) (*ArtistAlbumData, error)
- func (b *Box) FetchArtistTopTrack(id string, params ...Param) (*AlbumTrackData, error)
- func (b *Box) FetchChartPlayList(platListID string, params ...Param) (*PlayListData, error)
- func (b *Box) FetchChartPlayListTrack(platListID string, params ...Param) (*TrackData, error)
- func (b *Box) FetchCharts(params ...Param) (*GroupListData, error)
- func (b *Box) FetchFeatured(params ...Param) (*GroupListData, error)
- func (b *Box) FetchFeaturedCategory(params ...Param) (*GroupListData, error)
- func (b *Box) FetchFeaturedCategoryPlayList(id string, params ...Param) (*GroupListData, error)
- func (b *Box) FetchFeaturedPlayList(playList string, params ...Param) (*PlayListData, error)
- func (b *Box) FetchFeaturedPlayListTrack(playList string, params ...Param) (*TrackData, error)
- func (b *Box) FetchGenreStation(id string, params ...Param) (*GenreData, error)
- func (b *Box) FetchGenreStationList(params ...Param) (*GenreList, error)
- func (b *Box) FetchHitPlayList(playList string, params ...Param) (*PlayListData, error)
- func (b *Box) FetchHitPlayListTrack(playList string, params ...Param) (*TrackData, error)
- func (b *Box) FetchHits(params ...Param) (*GroupListData, error)
- func (b *Box) FetchMoodStation(id string, params ...Param) (*MoodData, error)
- func (b *Box) FetchMoodStationList(params ...Param) (*MoodListData, error)
- func (b *Box) FetchReleaseCategory(params ...Param) (*ReleaseCategoryList, error)
- func (b *Box) FetchReleaseCategoryAlbum(id string, params ...Param) (*ArtistAlbumData, error)
- func (b *Box) FetchSearchData(key string, params ...Param) (*SearchData, error)
- func (b *Box) FetchSharedPlayList(id string, params ...Param) (*PlayListData, error)
- func (b *Box) FetchSharedPlayListTrack(id string, params ...Param) (*TrackData, error)
- func (b *Box) FetchSingleFeaturedCategory(id string, params ...Param) (*CategoryListData, error)
- func (b *Box) FetchSingleReleaseCategory(id string, params ...Param) (*AlbumList, error)
- func (b *Box) FetchTrack(id string) (*Track, error)
- func (b *Box) GetToken() (*AuthData, error)
- type CategoryListData
- type GenreData
- type GenreList
- type GroupListData
- type Image
- type MoodData
- type MoodListData
- type Owner
- type Paging
- type Param
- type PlayListData
- type ReleaseCategoryList
- type SearchData
- type Song
- type Summary
- type Track
- type TrackData
Constants ¶
const ( // OAuthTokenURL for auth token url OAuthTokenURL = "https://account.kkbox.com/oauth2/token" // ChartURL List of song rankings. ChartURL = "https://api.kkbox.com/v1.1/charts" // ChartPlayListURL retrieve information of the song ranking // with {playlist_id}. ChartPlayListURL = ChartURL + "/%s" // ChartPlayListTrackURL list tracks of a chart playlist. ChartPlayListTrackURL = ChartURL + "/%s/tracks" // NewHitURL List of new hits playlists. NewHitURL = "https://api.kkbox.com/v1.1/new-hits-playlists" // NewHitPlayListURL retrieve information of the new hits playlist // with {playlist_id}. NewHitPlayListURL = NewHitURL + "/%s" // NewHitPlayListTrackURL List of tracks of a new hits playlist. NewHitPlayListTrackURL = NewHitURL + "/%s/tracks" // SearchURL search for various objects. SearchURL = "https://api.kkbox.com/v1.1/search" // TrackURL retrieve information of the song with {track_id}. TrackURL = "https://api.kkbox.com/v1.1/tracks/%s" // AlbumURL retrieve information of the album with {album_id}. AlbumURL = "https://api.kkbox.com/v1.1/albums/%s" // AlbumTrackURL list of tracks of an album. AlbumTrackURL = AlbumURL + "/tracks" // ArtistURL retrieve information of the artist with {artist_id}. ArtistURL = "https://api.kkbox.com/v1.1/artists/%s" // ArtistAlbumURL List of albums of an artist. ArtistAlbumURL = ArtistURL + "/albums" // ArtistTopTrackURL List of top tracks of an artist. ArtistTopTrackURL = ArtistURL + "/top-tracks" // ArtistRelatedArtistURL Get related artists of an artist. ArtistRelatedArtistURL = ArtistURL + "/related-artists" SharedPlaylistURL = "https://api.kkbox.com/v1.1/shared-playlists/%s" SharedPlaylistTrackURL = "https://api.kkbox.com/v1.1/shared-playlists/%s/tracks" // FeaturedPlayListURL List of songs hand-picked and arranged by KKBOX editors. FeaturedPlayListURL = "https://api.kkbox.com/v1.1/featured-playlists" // FeaturedSinglePlayListURL retrieve information of the featured playlist with {playlist_id}. FeaturedSinglePlayListURL = FeaturedPlayListURL + "/%s" // FeaturedPlayListTrackURL List the songs of a featured playlist. FeaturedPlayListTrackURL = FeaturedPlayListURL + "/%s/tracks" // FeaturedCategoryURL List of featured playlist categories. FeaturedCategoryURL = "https://api.kkbox.com/v1.1/featured-playlist-categories" // FeaturedSingleCategoryURL Get A Featured Playlist Category. FeaturedSingleCategoryURL = FeaturedCategoryURL + "/%s" // FeaturedCategoryPlayListURL List of playlists of a featured playlist category. FeaturedCategoryPlayListURL = FeaturedCategoryURL + "/%s/playlists" // MoodStationURL List of mood stations. MoodStationURL = "https://api.kkbox.com/v1.1/mood-stations" // MoodSingleStationURL To retrieve information of the mood station with {station_id}. MoodSingleStationURL = MoodStationURL + "/%s" // GenreStationURL List of genre stations. GenreStationURL = "https://api.kkbox.com/v1.1/mood-stations" // GenreSingleStationURL retrieve information of the genre station with {station_id}. GenreSingleStationURL = GenreStationURL + "/%s" // ReleaseCategoryURL List of new release categories. ReleaseCategoryURL = "https://api.kkbox.com/v1.1/new-release-categories" // ReleaseSingleCategoryURL retrieve information of the new release category with {category_id}. ReleaseSingleCategoryURL = ReleaseCategoryURL + "/%s" // ReleaseCategoryAlbumURL List of albums of a new release category. ReleaseCategoryAlbumURL = ReleaseCategoryURL + "/%s/albums" )
Variables ¶
var ( // ErrorMissingIDorSecret for missing client id or secret ErrorMissingIDorSecret = errors.New("missing client id or secret") // ErrorInvalidClient for wrong token ErrorInvalidClient = errors.New("invalid_client") )
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` Explicitness bool `json:"explicitness"` AvailableTerritories []string `json:"available_territories"` ReleaseDate string `json:"release_date"` Images []Image `json:"images"` Artist Artist `json:"artist"` }
Album data
type AlbumList ¶
type AlbumList struct { ID string `json:"id"` Title string `json:"title"` Albums struct { Data []Album `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"albums"` }
AlbumList retrieve information of the new release category with {category_id}.
type AlbumTrackData ¶
type AlbumTrackData struct { Data []Track `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
AlbumTrackData list of tracks of an album.
type Artist ¶
type Artist struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` Images []Image `json:"images"` }
Artist struct
type ArtistAlbumData ¶
type ArtistAlbumData struct { Data []Album `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
ArtistAlbumData list of albums of an artist.
type AuthData ¶
type AuthData struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` TokenType string `json:"token_type"` Error string `json:"error"` }
AuthData for access token
type Box ¶
Box struct
func (*Box) FetchAlbum ¶
FetchAlbum retrieve information of the album with {album_id}.
func (*Box) FetchAlbumTrack ¶
func (b *Box) FetchAlbumTrack(id string, params ...Param) (*AlbumTrackData, error)
FetchAlbumTrack list of tracks of an album..
func (*Box) FetchArtist ¶
FetchArtist retrieve information of the artist with {artist_id}..
func (*Box) FetchArtistAlbum ¶
func (b *Box) FetchArtistAlbum(id string, params ...Param) (*ArtistAlbumData, error)
FetchArtistAlbum list of albums of an artist.
func (*Box) FetchArtistRelated ¶
func (b *Box) FetchArtistRelated(id string, params ...Param) (*ArtistAlbumData, error)
FetchArtistRelated List of top tracks of an artist.
func (*Box) FetchArtistTopTrack ¶
func (b *Box) FetchArtistTopTrack(id string, params ...Param) (*AlbumTrackData, error)
FetchArtistTopTrack List of top tracks of an artist.
func (*Box) FetchChartPlayList ¶
func (b *Box) FetchChartPlayList(platListID string, params ...Param) (*PlayListData, error)
FetchChartPlayList to retrieve information of the song ranking with {playlist_id}.
func (*Box) FetchChartPlayListTrack ¶
FetchChartPlayListTrack to retrieve information of the song ranking with {playlist_id}.
func (*Box) FetchCharts ¶
func (b *Box) FetchCharts(params ...Param) (*GroupListData, error)
FetchCharts List of song rankings.
func (*Box) FetchFeatured ¶
func (b *Box) FetchFeatured(params ...Param) (*GroupListData, error)
FetchFeatured List of songs hand-picked and arranged by KKBOX editors.
func (*Box) FetchFeaturedCategory ¶
func (b *Box) FetchFeaturedCategory(params ...Param) (*GroupListData, error)
FetchFeaturedCategory List of featured playlist categories.
func (*Box) FetchFeaturedCategoryPlayList ¶
func (b *Box) FetchFeaturedCategoryPlayList(id string, params ...Param) (*GroupListData, error)
FetchFeaturedCategoryPlayList list of playlists of a featured playlist category.
func (*Box) FetchFeaturedPlayList ¶
func (b *Box) FetchFeaturedPlayList(playList string, params ...Param) (*PlayListData, error)
FetchFeaturedPlayList retrieve information of the featured playlist with {playlist_id}.
func (*Box) FetchFeaturedPlayListTrack ¶
FetchFeaturedPlayListTrack list the songs of a featured playlist.
func (*Box) FetchGenreStation ¶
FetchGenreStation retrieve information of the genre station with {station_id}.
func (*Box) FetchGenreStationList ¶
FetchGenreStationList List of genre stations.
func (*Box) FetchHitPlayList ¶
func (b *Box) FetchHitPlayList(playList string, params ...Param) (*PlayListData, error)
FetchHitPlayList retrieve information of the new hits playlist with {playlist_id}.
func (*Box) FetchHitPlayListTrack ¶
FetchHitPlayListTrack list of tracks of a new hits playlist.
func (*Box) FetchHits ¶
func (b *Box) FetchHits(params ...Param) (*GroupListData, error)
FetchHits List of new hits playlists.
func (*Box) FetchMoodStation ¶
FetchMoodStation retrieve information of the mood station with {station_id}.
func (*Box) FetchMoodStationList ¶
func (b *Box) FetchMoodStationList(params ...Param) (*MoodListData, error)
FetchMoodStationList List of mood stations.
func (*Box) FetchReleaseCategory ¶
func (b *Box) FetchReleaseCategory(params ...Param) (*ReleaseCategoryList, error)
FetchReleaseCategory List of new release categories.
func (*Box) FetchReleaseCategoryAlbum ¶
func (b *Box) FetchReleaseCategoryAlbum(id string, params ...Param) (*ArtistAlbumData, error)
FetchReleaseCategoryAlbum list of albums of a new release category.
func (*Box) FetchSearchData ¶
func (b *Box) FetchSearchData(key string, params ...Param) (*SearchData, error)
FetchSearchData Search for various objects..
func (*Box) FetchSharedPlayList ¶
func (b *Box) FetchSharedPlayList(id string, params ...Param) (*PlayListData, error)
FetchSharedPlayList retrieve information of the shared playlist with {playlist_id}.
func (*Box) FetchSharedPlayListTrack ¶
FetchSharedPlayListTrack list of songs of a shared playlist..
func (*Box) FetchSingleFeaturedCategory ¶
func (b *Box) FetchSingleFeaturedCategory(id string, params ...Param) (*CategoryListData, error)
FetchSingleFeaturedCategory get a featured playlist category.
func (*Box) FetchSingleReleaseCategory ¶
FetchSingleReleaseCategory retrieve information of the new release category with {category_id}.
func (*Box) FetchTrack ¶
FetchTrack retrieve information of the song with {track_id}.
type CategoryListData ¶
type CategoryListData struct { ID string `json:"id"` Title string `json:"title"` Images []Image `json:"images"` Playlists GroupListData `json:"playlists"` }
CategoryListData for category
type GenreData ¶
type GenreData struct { Category string `json:"category"` ID string `json:"id"` Name string `json:"name"` Tracks struct { Data []Track `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"tracks"` }
GenreData retrieve information of the genre station with {station_id}.
type GenreList ¶
type GenreList struct { Data []struct { ID string `json:"id"` Category string `json:"category"` Name string `json:"name"` } `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
GenreList List of genre stations.
type GroupListData ¶
type GroupListData struct { Data []Song `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
GroupListData for song list
type MoodData ¶
type MoodData struct { ID string `json:"id"` Name string `json:"name"` Tracks struct { Data []Track `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"tracks"` }
MoodData retrieve information of the mood station with {station_id}.
type MoodListData ¶
type MoodListData struct { Data []struct { ID string `json:"id"` Name string `json:"name"` Images []Image `json:"images"` } `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
MoodListData mood stations.
type Paging ¶
type Paging struct { Offset int `json:"offset"` Limit int `json:"limit"` Previous string `json:"previous"` Next string `json:"next"` }
Paging data
type Param ¶
type Param struct { // The search keywords, URL encoded. Q string // The content type. Content type could be track, album, artist, or playlist. Type string // Territory code, i.e. TW, HK, SG, MY, JP, of search content. Territory string Page int // The number of items to return per page, not to exceed 50. PerPage int }
Param for http get parameter
type PlayListData ¶
type PlayListData struct { Tracks struct { Data []Track `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"tracks"` ID string `json:"id"` Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` Images []Image `json:"images"` UpdatedAt time.Time `json:"updated_at"` Owner Owner `json:"owner"` }
PlayListData to retrieve information of playlist
type ReleaseCategoryList ¶
type ReleaseCategoryList struct { Data []struct { ID string `json:"id"` Title string `json:"title"` } `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
ReleaseCategoryList List of new release categories.
type SearchData ¶
type SearchData struct { Artists struct { Data []Artist `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"artists"` Tracks struct { Data []Track `json:"data"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` } `json:"tracks"` Paging Paging `json:"paging"` Summary Summary `json:"summary"` }
SearchData for search results
type Song ¶
type Song struct { ID string `json:"id"` Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` Images []Image `json:"images"` UpdatedAt time.Time `json:"updated_at"` Owner Owner `json:"owner"` }
Song for play list
type Track ¶
type Track struct { ID string `json:"id"` Name string `json:"name"` Duration int `json:"duration"` URL string `json:"url"` TrackNumber int `json:"track_number"` Explicitness bool `json:"explicitness"` AvailableTerritories []string `json:"available_territories"` Album Album `json:"album"` }
Track data