Documentation ¶
Overview ¶
Package spotify: go-spotify provides an easy-to-use API to access Spotify's WEB API
Index ¶
- Constants
- type Spotify
- func (spotify *Spotify) Authorize() (bool, []error)
- func (spotify *Spotify) Delete(format string, args ...interface{}) ([]byte, []error)
- func (spotify *Spotify) Get(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
- func (spotify *Spotify) Post(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
- func (spotify *Spotify) Put(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
- func (spotify *Spotify) Request(method, format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
Constants ¶
const ( BASE_URL = "https://api.spotify.com" ACCOUNTS_URL = "https://accounts.spotify.com/api/token" API_VERSION = "v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Spotify ¶
type Spotify struct {
// contains filtered or unexported fields
}
Spotify struct which we use to wrap our request operations.
func New ¶
Creates a New Spotify API object with the clientID and clientSecret Usage:
spotify.New("XXX","YYY")
func (*Spotify) Delete ¶
This version does not support User Authentication so POST/PUT/DELETE Request won't work.
Creates a new DELETE Request to Spotify and returns the response as a map[string]interface{}.
format: target endpoint format like "me/tracks?ids=%s" - string
args: Arguments to be used based on format
Usage:
spotify.Delete("me/tracks?ids=%s","4iV5W9uYEdYUVa79Axb7Rh")
func (*Spotify) Get ¶
func (spotify *Spotify) Get(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
Creates a new GET Request to Spotify and returns the response as a map[string]interface{}.
format: target endpoint format like "albums/%s" - string
data: content to be sent with the request - map[string]interface{}
args: Arguments to be used based on format
Usage:
spotify.Get("albums/%s",nil,0sNOF9WDwhWunNAHPD3Baj)
func (*Spotify) Post ¶
func (spotify *Spotify) Post(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
This version does not support User Authentication so POST/PUT/DELETE Request won't work.
Creates a new POST Request to Spotify and returns the response as a map[string]interface{}.
format: target endpoint format like "users/%s/playlists" - string
data: content to be sent with the request - map[string]interface{}
args: Arguments to be used based on format
Usage:
spotify.Post("users/%s/playlists",map[string]interface{},"wizzler")
func (*Spotify) Put ¶
func (spotify *Spotify) Put(format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
This version does not support User Authentication so POST/PUT/DELETE Request won't work.
Creates a new PUT Request to Spotify and returns the response as a map[string]interface{}.
format: target endpoint format like "me/tracks?ids=%s" - string
data: content to be sent with the request - map[string]interface{}
args: Arguments to be used based on format
Usage:
spotify.Put("me/tracks?ids=%s",nil,"4iV5W9uYEdYUVa79Axb7Rh")
func (*Spotify) Request ¶
func (spotify *Spotify) Request(method, format string, data map[string]interface{}, args ...interface{}) ([]byte, []error)
Creates a new Request to Spotify and returns the response as a map[string]interface{}.
method: GET/POST/PUT/DELETE - string
format: target endpoint format like "albums/%s" - string
data: content to be sent with the request - map[string]interface{}
args: Arguments to be used based on format
Usage:
spotify.request("GET","albums/%s",nil,"0sNOF9WDwhWunNAHPD3Baj")