forked from amencarini/songkick
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathartist.go
More file actions
34 lines (28 loc) · 746 Bytes
/
Copy pathartist.go
File metadata and controls
34 lines (28 loc) · 746 Bytes
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
package songkick
type Artist struct {
Ontouruntil interface{} `json:"onTourUntil"`
Identifier []struct {
Setlistshref string `json:"setlistsHref"`
Href string `json:"href"`
Mbid string `json:"mbid"`
Eventshref string `json:"eventsHref"`
} `json:"identifier"`
URI string `json:"uri"`
ID uint `json:"id"`
Name string `json:"displayName"`
}
type Concert struct {
Name string `json:"displayName"`
}
func (c *Client) SearchArtist(query string) ([]Artist, error) {
var artists []Artist
params := map[string]string{
"query": query,
}
result, err := c.doSearch("search/artists.json", params)
if err != nil {
return artists, err
}
artists = result.Resultspage.Results.Artists
return artists, nil
}