Documentation
¶
Index ¶
- Constants
- Variables
- func Get(url string, result interface{}) error
- type AdvancedSearch
- type Album
- type AlbumList
- func GetArtistAlbums(id, index, limit int) (AlbumList, error)
- func GetChartAlbums(id, index, limit int) (AlbumList, error)
- func GetEditorialReleases(id, index, limit int) (AlbumList, error)
- func GetEditorialSelection(id int, date string, index, limit int) (AlbumList, error)
- func GetUserAlbums(id, index, limit int) (AlbumList, error)
- func SearchAlbum(query string, strict bool, order string, index, limit int) (AlbumList, error)
- type Artist
- type ArtistList
- func GetArtistRelated(id, index, limit int) (ArtistList, error)
- func GetChartArtists(id, index, limit int) (ArtistList, error)
- func GetGenreArtists(id int) (ArtistList, error)
- func GetUserArtists(id, index, limit int) (ArtistList, error)
- func SearchArtist(query string, strict bool, order string, index, limit int) (ArtistList, error)
- type Chart
- type Comment
- type CommentList
- type Editorial
- type EditorialList
- type Error
- type ErrorResponse
- type ExtendedAlbumList
- type ExtendedArtistList
- type ExtendedGenreList
- type ExtendedPlaylistList
- type ExtendedTrackList
- type Genre
- type GenreList
- type GenreRadio
- type GenreRadioList
- type Playlist
- type PlaylistList
- type Radio
- type RadioList
- type Track
- type TrackList
- func GetAlbumTracks(id, index, limit int) (TrackList, error)
- func GetArtistRadio(id, index, limit int) (TrackList, error)
- func GetArtistTop(id, index, limit int) (TrackList, error)
- func GetChartTracks(id, index, limit int) (TrackList, error)
- func GetPlaylistTracks(id, index, limit int) (TrackList, error)
- func GetRadioTracks(id, index, limit int) (TrackList, error)
- func GetUserCharts(id, index, limit int) (TrackList, error)
- func GetUserFlow(id, index, limit int) (TrackList, error)
- func GetUserTracks(id, index, limit int) (TrackList, error)
- func SearchTrack(query string, strict bool, order string, index, limit int) (TrackList, error)
- type User
- type UserList
- func GetAlbumFans(id, index, limit int) (UserList, error)
- func GetArtistFans(id, index, limit int) (UserList, error)
- func GetPlaylistFans(id, index, limit int) (UserList, error)
- func GetUserFollowings(id, index, limit int) (UserList, error)
- func SearchUser(query string, strict bool, order string, index, limit int) (UserList, error)
Constants ¶
View Source
const ( ERR_QUOTA = 4 ERR_PERMISSION = 200 ERR_TOKEN_INVALID = 300 ERR_PARAMETER = 500 ERR_PARAMETER_MISSING = 501 ERR_QUERY_INVALID = 600 ERR_SERVICE_BUSY = 700 ERR_DATA_NOT_FOUND = 800 )
View Source
const ( RANKING = "RANKING" TRACK_ASC = "TRACK_ASC" TRACK_DESC = "TRACK_DESC" ARTIST_ASC = "ARTIST_ASC" ARTIST_DESC = "ARTIST_DESC" ALBUM_ASC = "ALBUM_ASC" ALBUM_DESC = "ALBUM_DESC" RATING_ASC = "RATING_ASC" RATING_DESC = "RATING_DESC" DURATION_ASC = "DURATION_ASC" DURATION_DESC = "DURATION_DESC" )
Variables ¶
View Source
var BaseUrl = "http://api.deezer.com"
Functions ¶
Types ¶
type AdvancedSearch ¶
type AdvancedSearch struct {
Artist string
Album string
Track string
Label string
DurMin int
DurMax int
BPMMin int
BPMMax int
}
func (AdvancedSearch) String ¶
func (a AdvancedSearch) String() (s string)
type Album ¶
type Album struct {
ID int `json:"id,omitempty"` // The Deezer album id
Title string `json:"title,omitempty"` // The album title
UPC string `json:"upc,omitempty"` // The album UPC
Link string `json:"link,omitempty"` // The url of the album on Deezer url
Cover string `json:"cover,omitempty"` // The url of the album's cover.
GenreID int `json:"genre_id,omitempty"` // The album's first genre id. NB : -1 for not found
Genres GenreList `json:"genres,omitempty"` // List of genre object
Label string `json:"label,omitempty"` // The album's label name
NbTracks int `json:"nb_tracks,omitempty"` // Number of tracks
Duration int `json:"duration,omitempty"` // The album's duration (seconds)
Fans int `json:"fans,omitempty"` // The number of album's Fans
Rating int `json:"rating,omitempty"` // The playlist's rate
ReleaseDate string `json:"release_date,omitempty"` // The album's release date
RecordType string `json:"record_type,omitempty"` // The record type of the album (EP / ALBUM / etc..)
Available bool `json:"available,omitempty"` // If the album is avaiable
// Alternative Album `json:"alternative,omitempty"` // Return an alternative album object if the current album is not available
Tracklist string `json:"tracklist,omitempty"` // API Link to the tracklist of this album
ExplicitLyrics bool `json:"explicit_lyrics,omitempty"` // Whether the album contains explicit lyrics
Contributors []Artist `json:"contributors,omitempty"` // Return a list of contributors on the album
Artist *Artist `json:"artist,omitempty"` // artist object containing : id, name, picture
Tracks TrackList `json:"tracks,omitempty"` // list of track
}
type AlbumList ¶
type AlbumList []Album
func GetArtistAlbums ¶
func GetChartAlbums ¶
func GetEditorialReleases ¶
func GetEditorialSelection ¶
func GetUserAlbums ¶
func SearchAlbum ¶
func (*AlbumList) UnmarshalJSON ¶
type Artist ¶
type Artist struct {
ID int `json:"id,omitempty"` // The artist's Deezer id
Name string `json:"name,omitempty"` // name The artist's name
Link string `json:"link,omitempty"` // The url of the artist on Deezer
Picture string `json:"picture,omitempty"` // The url of the artist picture.
NbAlbum int `json:"nb_album,omitempty"` // The number of artist's albums
NbFan int `json:"nb_fan,omitempty"` // The number of artist's fans
Radio bool `json:"radio,omitempty"` // true if the artist has a smartradio
Tracklist string `json:"tracklist,omitempty"` // API Link to the top of this artist
Role string `json:"role,omitempty"` // The artist's role in a track or album
Albums AlbumList `json:"albums,omitempty"`
Tracks TrackList `json:"tracks,omitempty"`
}
type ArtistList ¶
type ArtistList []Artist
func GetArtistRelated ¶
func GetArtistRelated(id, index, limit int) (ArtistList, error)
func GetChartArtists ¶
func GetChartArtists(id, index, limit int) (ArtistList, error)
func GetGenreArtists ¶
func GetGenreArtists(id int) (ArtistList, error)
func GetUserArtists ¶
func GetUserArtists(id, index, limit int) (ArtistList, error)
func SearchArtist ¶
func (*ArtistList) UnmarshalJSON ¶
func (a *ArtistList) UnmarshalJSON(data []byte) error
type Chart ¶
type Chart struct {
Tracks TrackList `json:"tracks,omitempty"`
Albums AlbumList `json:"albums,omitempty"`
Artists ArtistList `json:"artists,omitempty"`
Playlists PlaylistList `json:"playlists,omitempty"`
}
func GetEditorialCharts ¶
type Comment ¶
type Comment struct {
ID int `json:"id,omitempty"`
Text string `json:"text,omitempty"`
Date int `json:"date,omitempty"`
Object Playlist `json:"object,omitempty"`
Author User `json:"author,omitempty"`
}
func GetComment ¶
type CommentList ¶
type CommentList struct {
Data []Comment `json:"data,omitempty"`
Total int `json:"total,omitempty"`
Next string `json:"next,omitempty"`
}
func GetAlbumComments ¶
func GetAlbumComments(id, index, limit int) (CommentList, error)
func GetArtistComments ¶
func GetArtistComments(id, index, limit int) (CommentList, error)
func GetPlaylistComments ¶
func GetPlaylistComments(id, index, limit int) (CommentList, error)
type Editorial ¶
type Editorial struct {
ID int `json:"id,omitempty"` // The editorial's Deezer id
Name string `json:"name,omitempty"` // The editorial's name
}
func GetEditorial ¶
type EditorialList ¶
type EditorialList struct {
Data []Editorial `json:"data,omitempty"`
Total int `json:"total,omitempty"`
Next string `json:"next,omitempty"`
}
func GetEditorials ¶
func GetEditorials() (EditorialList, error)
type Error ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error Error `json:"error,omitempty"`
}
type ExtendedAlbumList ¶
type ExtendedArtistList ¶
type ExtendedGenreList ¶
type ExtendedGenreList struct {
Data []Genre `json:"data,omitempty"`
}
type ExtendedPlaylistList ¶
type ExtendedTrackList ¶
type GenreRadio ¶
type GenreRadioList ¶
type GenreRadioList struct {
Data []GenreRadio `json:"data,omitempty"`
}
func GetRadioGenres ¶
func GetRadioGenres() (GenreRadioList, error)
type Playlist ¶
type Playlist struct {
ID int `json:"id,omitempty"` // The playlist's Deezer id
Title string `json:"title,omitempty"` // The playlist's title
Description string `json:"description,omitempty"` // The playlist description
Duration int `json:"duration,omitempty"` // The playlist's duration (seconds)
Public bool `json:"public,omitempty"` // If the playlist is public or not
IsLovedTrack bool `json:"is_loved_track,omitempty"` // If the playlist is the love tracks playlist
Collaborative bool `json:"collaborative,omitempty"` // If the playlist is collaborative or not
Rating int `json:"rating,omitempty"` // The playlist's rate
Fans int `json:"fans,omitempty"` // The number of playlist's fans
Link string `json:"link,omitempty"` // The url of the playlist on Deezer
Picture string `json:"picture,omitempty"` // The url of the playlist's cover.
Checksum string `json:"hecksum,omitempty"` // The checksum for the track list
Creator *User `json:"creator,omitempty"` // User object containing : id, name
Tracks TrackList `json:"tracks,omitempty"` // List of tracks
}
func GetPlaylist ¶
type PlaylistList ¶
type PlaylistList []Playlist
func GetChartPlaylists ¶
func GetChartPlaylists(id, index, limit int) (PlaylistList, error)
func GetUserPlaylists ¶
func GetUserPlaylists(id, index, limit int) (PlaylistList, error)
func SearchPlaylist ¶
func (*PlaylistList) UnmarshalJSON ¶
func (p *PlaylistList) UnmarshalJSON(data []byte) error
type Radio ¶
type Radio struct {
ID int `json:"id,omitempty"` // The radio deezeid
Title string `json:"title,omitempty"` // The radio title
Description string `json:"description,omitempty"` // The radio title
Picture string `json:"picture,omitempty"` // The url of the radio picture.
Tracklist string `json:"tracklist,omitempty"` // API Link to the tracklist of this radio
}
type RadioList ¶
type RadioList struct {
Data []Radio `json:"data,omitempty"`
}
func GetGenreRadios ¶
func GetRadioTop ¶
func GetUserRadios ¶
type Track ¶
type Track struct {
ID int `json:"id,omitempty"` // The track's Deezer id
Readable bool `json:"readable,omitempty"` // true if the track is readable in the player for the current user
Title string `json:"title,omitempty"` // The track's title
Isrc string `json:"isrc,omitempty"` // The track isrc
Link string `json:"link,omitempty"` // The url of the track on Deezer
Duration int `json:"duration,omitempty"` // The track's duration in seconds
TrackPosition int `json:"track_position,omitempty"` // The position of the track in its album
DiskNumber int `json:"disk_number,omitempty"` // The track's album's disk number
Rank int `json:"rank,omitempty"` // The track's Deezer rank
ReleaseDate string `json:"release_date,omitempty"` // The track's release date
ExplicitLyrics bool `json:"explicit_lyrics,omitempty"` // Whether the track contains explicit lyrics
Preview string `json:"preview,omitempty"` // The url of track's preview file. This file contains the first 30 seconds of the track
Bpm float64 `json:"bpm,omitempty"` // Beats per minute
Gain float64 `json:"gain,omitempty"` // Signal strength
AvailableCountries []string `json:"available_countries,omitempty"` // List of countries where the track is available
// Alternative Track `json:"alternative,omitempty"` // Return an alternative readable track if the current track is not readable
Contributors []Artist `json:"contributors,omitempty"` // Return a list of contributors on the track
Artist *Artist `json:"artist,omitempty"` // artist object containing : id, name, link, share, picture, nb_album, nb_fan, radio, tracklist, role
Album *Album `json:"album,omitempty"` // album object containing : id, title, link, cover, release_date
}
type TrackList ¶
type TrackList []Track
func GetAlbumTracks ¶
func GetArtistRadio ¶
func GetArtistTop ¶
func GetChartTracks ¶
func GetPlaylistTracks ¶
func GetRadioTracks ¶
func GetUserCharts ¶
func GetUserFlow ¶
func GetUserTracks ¶
func SearchTrack ¶
func (*TrackList) UnmarshalJSON ¶
type User ¶
type User struct {
ID int `json:"id,omitempty"` // The user's Deezer ID
Name string `json:"name,omitempty"` // The user's Deezer nickname
Lastname string `json:"lastname,omitempty"` // The user's last name
Firstname string `json:"firstname,omitempty"` // The user's first name
Email string `json:"email,omitempty"` // The user's email
Status int `json:"status,omitempty"` // The user's status
Birthday int `json:"birthday,omitempty"` // The user's birthday
InscriptionDate int `json:"inscription_date,omitempty"` // The user's inscription date
Gender string `json:"gender,omitempty"` // The user's gender : F or M
Link string `json:"link,omitempty"` // The url of the profil for the user on Deezer
Picture string `json:"picture,omitempty"` // The url of the user's profil picture.
Country string `json:"country,omitempty"` // The user's country
Lang string `json:"lang,omitempty"` // The user's language
Tracklist string `json:"tracklist,omitempty"` // API Link to the flow of this user
}
type UserList ¶
type UserList struct {
Data []User `json:"data,omitempty"`
Total int `json:"total,omitempty"`
Next string `json:"next,omitempty"`
}
func GetAlbumFans ¶
func GetArtistFans ¶
func GetPlaylistFans ¶
func GetUserFollowings ¶
Click to show internal directories.
Click to hide internal directories.