deezer

package module
v0.0.0-...-0e4d0e9 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

README ΒΆ

Welcome to go-deezer πŸ‘‹ *** Work In Progress ***

GitHub code size in bytes GitHub go.mod Go version GitHub closed pull requests GitHub pull requests GitHub issues GitHub contributors

go-deezer is a Go client library for accessing the Deezer API

🚚 Install

go get github.com/tsirysndr/go-deezer

πŸš€ Usage

Import the package into your project.

import "github.com/tsirysndr/go-deezer"

Construct a new Deezer client, then use the various services on the client to access different parts of the Deezer API. For example:

client := deezer.NewClient()
res, _ := client.Artist.Get("27")
artist, _ := json.Marshal(res)
fmt.Println(string(artist))

✨ Coverage

Currently the following services are supported:

  • Get an Album
  • Return a list of album's comments
  • Return a list of album's fans
  • Return a list of album's tracks
  • Get an Artist
  • Get the top 5 tracks of an artist
  • Return a list of artist's albums
  • Return a list of artist's comments
  • Return a list of artist's fans
  • Return a list of related artists
  • Return a list of tracks
  • Return a list of artist's playlist
  • Returns the Top tracks
  • Returns the Top albums
  • Returns the Top artists
  • Returns the Top playlists
  • Returns the Top podcasts
  • Remove a comment
  • Add a comment to the album
  • Add a comment to the artist
  • Add a comment to the playlist
  • Return a list of albums selected every week by the Deezer Team
  • Returns all artists for a genre
  • Get a Genre
  • Returns all radios for a genre
  • Get the information about the API in the current country
  • Get the user's options
  • Get a playlist
  • Rate the playlist
  • Update the playlist
  • Delete the playlist
  • Add a playlist to the folder
  • Remove a playlist from the folder
  • Create a playlist
  • Add a playlist to the user's favorites
  • Remove a playlist from the user's favorites
  • Return a list of playlist's comments
  • Return a list of playlist's fans
  • Return a list of playlist's tracks
  • Return a list of playlist's recommendation tracks
  • Get a radio
  • Add a radio to the user's favorites
  • Remove a radio from the user's favorites
  • Returns a list of radio splitted by genre
  • Return the top radios (25 radios)
  • Get first 40 tracks in the radio
  • Returns a list of personal radio splitted by genre (as MIX in website)
  • Search tracks
  • Get track
  • Update a personal track
  • Delete a personal track
  • Add a track to the playlist
  • Order tracks in the playlist
  • Remove tracks from the playlist
  • Add a track to the user's favorites
  • Remove a track from the user's favorites
  • Return a list of user's favorite albums
  • Return a list of user's favorite artists
  • Returns a list of the user's top 25 tracks
  • Returns a list of the user's top albums
  • Returns a list of the user's top playlists
  • Returns a list of the user's top artists

Author

πŸ‘€ Tsiry Sandratraina

Show your support

Give a ⭐️ if this project helped you!

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

This section is empty.

Functions ΒΆ

This section is empty.

Types ΒΆ

type Album ΒΆ

type Album struct {
	ID          int    `json:"id,omitempty"`
	Title       string `json:"title,omitempty"`
	UPC         string `json:"upc,omitempty"`
	Link        string `json:"link,omitempty"`
	Share       string `json:"share,omitempty"`
	Cover       string `json:"cover,omitempty"`
	CoverSmall  string `json:"cover_small,omitempty"`
	CoverMedium string `json:"cover_medium,omitempty"`
	CoverBig    string `json:"cover_big,omitempty"`
	CoverXL     string `json:"cover_xl,omitempty"`
	GenreID     int    `json:"genre_id,omitempty"`
	Genres      *struct {
		Data []Genre `json:"data,omitempty"`
	} `json:"genres,omitempty"`
	Label                 string   `json:"label,omitempty"`
	NbTracks              int      `json:"nb_tracks,omitempty"`
	Duration              int      `json:"duration,omitempty"`
	Fans                  int      `json:"fans,omitempty"`
	Rating                int      `json:"rating,omitempty"`
	ReleaseDate           string   `json:"release_date,omitempty"`
	RecordType            string   `json:"record_type,omitempty"`
	Available             bool     `json:"available,omitempty"`
	TrackList             string   `json:"tracklist,omitempty"`
	ExplicitLyrics        bool     `json:"explicit_lyrics,omitempty"`
	ExplicitContentLyrics int      `json:"explicit_content_lyrics,omitempty"`
	ExplicitContentCover  int      `json:"explicit_content_cover,omitempty"`
	Contributors          []Artist `json:"contributors,omitempty"`
	Artist                *Artist  `json:"artist,omitempty"`
	Type                  string   `json:"type,omitempty"`
	Tracks                *struct {
		Data []Track `json:"data,omitempty"`
	} `json:"tracks,omitempty"`
}

type AlbumService ΒΆ

type AlbumService service

func (*AlbumService) Get ΒΆ

func (s *AlbumService) Get(ID string) (*Album, error)

func (*AlbumService) GetComments ΒΆ

func (s *AlbumService) GetComments(ID string) (*Comments, error)

func (*AlbumService) GetFans ΒΆ

func (s *AlbumService) GetFans(ID string) (*Fans, error)

func (*AlbumService) GetTracks ΒΆ

func (s *AlbumService) GetTracks(ID string) (*Tracks, error)

type Albums ΒΆ

type Albums struct {
	Data  []Album `json:"data,omitempty"`
	Total int     `json:"total,omitempty"`
	Next  string  `json:"next,omitempty"`
}

type Artist ΒΆ

type Artist struct {
	ID            int    `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	Link          string `json:"link,omitempty"`
	Share         string `json:"share,omitempty"`
	Picture       string `json:"picture,omitempty"`
	PictureSmall  string `json:"picture_small,omitempty"`
	PictureMedium string `json:"picture_medium,omitempty"`
	PictureBig    string `json:"picture_big,omitempty"`
	PictureXl     string `json:"picture_xl,omitempty"`
	NbAlbum       int    `json:"nb_album,omitempty"`
	NbFan         int    `json:"nb_fan,omitempty"`
	Radio         bool   `json:"radio,omitempty"`
	TrackList     string `json:"tracklist,omitempty"`
	Type          string `json:"type,omitempty"`
}

type ArtistService ΒΆ

type ArtistService service

func (*ArtistService) Get ΒΆ

func (s *ArtistService) Get(ID string) (*Artist, error)

func (*ArtistService) GetAlbums ΒΆ

func (s *ArtistService) GetAlbums(ID string) (*Albums, error)

func (*ArtistService) GetComments ΒΆ

func (s *ArtistService) GetComments(ID string) (*Comments, error)

func (*ArtistService) GetFans ΒΆ

func (s *ArtistService) GetFans(ID string) (*Fans, error)

func (*ArtistService) GetPlaylists ΒΆ

func (s *ArtistService) GetPlaylists(ID string) (*Playlists, error)

func (*ArtistService) GetRadio ΒΆ

func (s *ArtistService) GetRadio(ID string) (*Radio, error)

func (*ArtistService) GetRelated ΒΆ

func (s *ArtistService) GetRelated(ID string) (*Related, error)

func (*ArtistService) GetTopFive ΒΆ

func (s *ArtistService) GetTopFive(ID string) (*Top, error)

type Artists ΒΆ

type Artists struct {
	Data  []Artist `json:"data,omitempty"`
	Total int      `json:"total,omitempty"`
	Next  string   `json:"next,omitempty"`
}

type ChartService ΒΆ

type ChartService service

func (*ChartService) Get ΒΆ

func (s *ChartService) Get()

func (*ChartService) GetAlbums ΒΆ

func (s *ChartService) GetAlbums() (*Albums, error)

func (*ChartService) GetArtists ΒΆ

func (s *ChartService) GetArtists() (*Artists, error)

func (*ChartService) GetPlaylists ΒΆ

func (s *ChartService) GetPlaylists() (*Playlists, error)

func (*ChartService) GetTracks ΒΆ

func (s *ChartService) GetTracks() (*Tracks, error)

type Client ΒΆ

type Client struct {
	Album     *AlbumService
	Artist    *ArtistService
	Chart     *ChartService
	Comment   *CommentService
	Editorial *EditorialService
	Genre     *GenreService
	Infos     *InfosService
	Options   *OptionsService
	Playlist  *PlaylistService
	Radio     *RadioService
	Search    *SearchService
	Track     *TrackService
	User      *UserService
	// contains filtered or unexported fields
}

func NewClient ΒΆ

func NewClient() *Client

type Comment ΒΆ

type Comment struct {
	ID     int    `json:"id,omitempty"`
	Text   string `json:"text,omitempty"`
	Date   int    `json:"date,omitempty"`
	Author *User  `json:"author,omitempty"`
	Type   string `json:"type,omitempty"`
}

type CommentService ΒΆ

type CommentService service

type Comments ΒΆ

type Comments struct {
	Data  []Comment `json:"data,omitempty"`
	Total int       `json:"total,omitempty"`
	Next  string    `json:"next,omitempty"`
}

type Contributor ΒΆ

type Contributor struct {
	ID            int    `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	Link          string `json:"link,omitempty"`
	Share         string `json:"share,omitempty"`
	Picture       string `json:"picture,omitempty"`
	PictureSmall  string `json:"picture_small,omitempty"`
	PictureMedium string `json:"picture_medium,omitempty"`
	PictureBig    string `json:"picture_big,omitempty"`
	PictureXL     string `json:"picture_xl,omitempty"`
	Radio         bool   `json:"radio,omitempty"`
	TrackList     string `json:"tracklist,omitempty"`
	Type          string `json:"type,omitempty"`
	Role          string `json:"role,omitempty"`
}

type EditorialService ΒΆ

type EditorialService service

type Fans ΒΆ

type Fans struct {
	Data  []User `json:"data,omitempty"`
	Total int    `json:"total,omitempty"`
	Next  string `json:"next,omitempty"`
}

type Genre ΒΆ

type Genre struct {
	ID            int    `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	Picture       string `json:"picture,omitempty"`
	PictureBig    string `json:"picture_big,omitempty"`
	PictureMedium string `json:"picture_medium,omitempty"`
	PictureSmall  string `json:"picture_small,omitempty"`
	PictureXL     string `json:"picture_xl,omitempty"`
	Type          string `json:"type,omitempty"`
}

type GenreService ΒΆ

type GenreService service

func (*GenreService) Get ΒΆ

func (s *GenreService) Get(ID int) (*Genre, error)

func (*GenreService) GetArtists ΒΆ

func (s *GenreService) GetArtists(ID int) (*Artists, error)

func (*GenreService) List ΒΆ

func (s *GenreService) List() (*Genres, error)

type Genres ΒΆ

type Genres struct {
	Data  []Genre `json:"data,omitempty"`
	Total int     `json:"total,omitempty"`
	Next  string  `json:"next,omitempty"`
}

type InfosService ΒΆ

type InfosService service

type OptionsService ΒΆ

type OptionsService service

type Playlist ΒΆ

type Playlist struct {
	ID            int    `json:"id,omitempty"`
	Title         string `json:"title,omitempty"`
	Public        bool   `json:"public,omitempty"`
	Link          string `json:"link,omitempty"`
	Picture       string `json:"picture,omitempty"`
	PictureSmall  string `json:"picture_small,omitempty"`
	PictureMedium string `json:"picture_medium,omitempty"`
	PictureBig    string `json:"picture_big,omitempty"`
	PictureXL     string `json:"picture_xl,omitempty"`
	Checksum      string `json:"checksum,omitempty"`
	Tracklist     string `json:"tracklist,omitempty"`
	CreationDate  string `json:"creation_date,omitempty"`
	User          *User  `json:"user,omitempty"`
	Type          string `json:"type,omitempty"`
}

type PlaylistService ΒΆ

type PlaylistService service

func (*PlaylistService) Get ΒΆ

func (s *PlaylistService) Get(ID string) (*Playlist, error)

func (*PlaylistService) GetComments ΒΆ

func (s *PlaylistService) GetComments(ID string) (*Comments, error)

func (*PlaylistService) GetFans ΒΆ

func (s *PlaylistService) GetFans(ID string) (*Fans, error)

func (*PlaylistService) GetTracks ΒΆ

func (s *PlaylistService) GetTracks(ID string) (*Tracks, error)

type Playlists ΒΆ

type Playlists struct {
	Data  []Playlist `json:"data,omitempty"`
	Total int        `json:"total,omitempty"`
	Next  string     `json:"next,omitempty"`
}

type Radio ΒΆ

type Radio struct {
	Data  []Track `json:"data,omitempty"`
	Total int     `json:"total,omitempty"`
	Next  string  `json:"next,omitempty"`
}

type RadioService ΒΆ

type RadioService service
type Related struct {
	Data  []Artist `json:"data,omitempty"`
	Total int      `json:"total,omitempty"`
	Next  string   `json:"next,omitempty"`
}

type SearchService ΒΆ

type SearchService service

type Top ΒΆ

type Top struct {
	Data  []Track `json:"data,omitempty"`
	Total int     `json:"total,omitempty"`
	Next  string  `json:"next,omitempty"`
}

type Track ΒΆ

type Track struct {
	ID                    int           `json:"id,omitempty"`
	Readable              bool          `json:"readable,omitempty"`
	Title                 string        `json:"title,omitempty"`
	TitleShort            string        `json:"title_short,omitempty"`
	TitleVersion          string        `json:"title_version,omitempty"`
	ISRC                  string        `json:"isrc,omitempty"`
	Link                  string        `json:"link,omitempty"`
	Duration              int           `json:"duration,omitempty"`
	Rank                  int           `json:"rank,omitempty"`
	ExplicitLyrics        bool          `json:"explicit_lyrics,omitempty"`
	ExplicitContentLyrics int           `json:"explicit_content_lyrics,omitempty"`
	ExplicitContentCover  int           `json:"explicit_content_cover,omitempty"`
	Preview               string        `json:"preview,omitempty"`
	Contributors          []Contributor `json:"contributors,omitempty"`
	Artist                *Artist       `json:"artist,omitempty"`
	Album                 *Album        `json:"album,omitempty"`
	Type                  string        `json:"type,omitempty"`
}

type TrackService ΒΆ

type TrackService service

func (*TrackService) Get ΒΆ

func (s *TrackService) Get(ID string) (*Track, error)

type Tracks ΒΆ

type Tracks struct {
	Data  []Track `json:"data,omitempty"`
	Total int     `json:"total,omitempty"`
	Next  string  `json:"next,omitempty"`
}

type User ΒΆ

type User struct {
	ID            int    `json:"id,omitempty"`
	Name          string `json:"name,omitempty"`
	Link          string `json:"link,omitempty"`
	Picture       string `json:"picture,omitempty"`
	PictureSmall  string `json:"picture_small,omitempty"`
	PictureMedium string `json:"picture_medium,omitempty"`
	PictureBig    string `json:"picture_big,omitempty"`
	PictureXL     string `json:"picture_xl,omitempty"`
	Tracklist     string `json:"tracklist,omitempty"`
	Type          string `json:"type,omitempty"`
}

type UserService ΒΆ

type UserService service

Directories ΒΆ

Path Synopsis
example
get-album command
get-album-fans command
get-artist command
get-artist-fans command
get-artist-top command
get-genre command
get-genres command
get-playlist command
get-top-albums command
get-top-artists command
get-top-tracks command

Jump to

Keyboard shortcuts

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