Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewAuthorizedClient ¶
func (*Client) CreatePlaylist ¶
func (c *Client) CreatePlaylist(payload CreatePlaylistPayload) (Playlist, error)
CreatePlaylist creates a playlist for a given user as described here: https://developer.spotify.com/documentation/web-api/reference/#/operations/create-playlist The name of the playlist is the only mandatory input.
func (*Client) GetUserPlaylists ¶
func (c *Client) GetUserPlaylists() (UserPlaylists, error)
GetUserPlaylists is targeting the endpoint described here in the spotify web api docs: https://developer.spotify.com/documentation/web-api/reference/#/operations/get-list-users-playlists xxx : this is not covering the entire functionality yet, e.g. the Pagination or the parsing of all existing response fields. This is just needed for the POC for now. ref.: https://github.com/HerrGustav/spotify-playlists/issues/1
func (*Client) IsAuthorized ¶
type CreatePlaylistPayload ¶
type Pagination ¶
type Pagination struct { Limit int64 `json:"limit"` Next string `json:"next"` Offset int64 `json:"offset"` Previous string `json:"previous"` Total int64 `json:"total"` }
Pagination is the representation of the pagination values that are typically included in every response of the spotify web api. This here is for keeping the code a bit more dry.
type Playlist ¶
type Playlist struct { Collaborative bool `json:"collaborative"` Description string `json:"description"` Href string `json:"href"` ID string `json:"id"` Name string `json:"name"` Public bool `json:"public"` SnapshotID string `json:"snapshot_id"` Type string `json:"type"` URI string `json:"uri"` Pagination }
Playlist is a minimal representation of the response object described here: https://developer.spotify.com/documentation/web-api/reference/#/operations/create-playlist It does not aim to be the complete representation for now.
type UserPlaylists ¶
type UserPlaylists struct { Href string `json:"href"` Items []interface{} `json:"items"` Pagination }
UserPlaylists is the minimal representation of this response // https://developer.spotify.com/documentation/web-api/reference/#/operations/get-list-users-playlists