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