-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeezer.go
48 lines (44 loc) · 1.14 KB
/
deezer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package deezer
import (
"github.com/dghubble/sling"
)
type Client struct {
base *sling.Sling
common service
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
}
type service struct {
client *Client
}
func NewClient() *Client {
base := sling.New().Base("https://api.deezer.com/")
c := &Client{}
c.base = base
c.common.client = c
c.Album = (*AlbumService)(&c.common)
c.Artist = (*ArtistService)(&c.common)
c.Chart = (*ChartService)(&c.common)
c.Comment = (*CommentService)(&c.common)
c.Editorial = (*EditorialService)(&c.common)
c.Genre = (*GenreService)(&c.common)
c.Infos = (*InfosService)(&c.common)
c.Options = (*OptionsService)(&c.common)
c.Playlist = (*PlaylistService)(&c.common)
c.Radio = (*RadioService)(&c.common)
c.Search = (*SearchService)(&c.common)
c.Track = (*TrackService)(&c.common)
c.User = (*UserService)(&c.common)
return c
}