Documentation ¶
Index ¶
- Variables
- type Album
- type ApiContext
- func (c *ApiContext) AddQueue(spotifyUri string) error
- func (c *ApiContext) AddTracks(ID string) error
- func (c *ApiContext) GetAllHistory() ([]History, error)
- func (c *ApiContext) GetHistory(limit int) (spotify_type.RecentlyPlayed, error)
- func (c *ApiContext) GetPlayNow() (spotify_type.CurrentlyPlaying, error)
- func (c *ApiContext) GetPlayer() (spotify_type.Player, error)
- func (c *ApiContext) Next() error
- func (c *ApiContext) Play(spotifyUri string) error
- func (c ApiContext) SetUserToken(token string) ApiContext
- type Artists
- type History
- type OAuth
- type QueryError
- type RefreshTokenRes
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiClient = InitApi()
View Source
var BadRequest = errors.New("bad request")
View Source
var NotFoundError = errors.New("not found")
View Source
var NotValidTokenError = errors.New("not valid token")
View Source
var OAuthClient = InitOAuth()
View Source
var TokenNotExpired = errors.New("token not expired")
Functions ¶
This section is empty.
Types ¶
type ApiContext ¶
type ApiContext struct { requests.RequestClient // contains filtered or unexported fields }
func InitApi ¶
func InitApi() ApiContext
func (*ApiContext) AddQueue ¶
func (c *ApiContext) AddQueue(spotifyUri string) error
func (*ApiContext) AddTracks ¶
func (c *ApiContext) AddTracks(ID string) error
func (*ApiContext) GetAllHistory ¶
func (c *ApiContext) GetAllHistory() ([]History, error)
func (*ApiContext) GetHistory ¶
func (c *ApiContext) GetHistory(limit int) (spotify_type.RecentlyPlayed, error)
GetHistory docs ApiContext: https://developer.spotify.com/documentation/web-api/reference/player/get-recently-played/
func (*ApiContext) GetPlayNow ¶
func (c *ApiContext) GetPlayNow() (spotify_type.CurrentlyPlaying, error)
GetPlayNow docs ApiContext: https://developer.spotify.com/documentation/web-api/reference/player/get-the-users-currently-playing-track/
func (*ApiContext) GetPlayer ¶
func (c *ApiContext) GetPlayer() (spotify_type.Player, error)
func (*ApiContext) Next ¶
func (c *ApiContext) Next() error
func (*ApiContext) Play ¶
func (c *ApiContext) Play(spotifyUri string) error
func (ApiContext) SetUserToken ¶
func (c ApiContext) SetUserToken(token string) ApiContext
type OAuth ¶
type OAuth struct { requests.RequestClient AuthorizationUrl *url.URL AccessTokenUrl string ApiUrl string RedirectUri string OAuthScope string // contains filtered or unexported fields }
func (*OAuth) GetAccessOrRefreshToken ¶
func (*OAuth) GetOAthUrl ¶
func (*OAuth) RefreshToken ¶
type QueryError ¶
type RefreshTokenRes ¶
func RefreshToken ¶
func RefreshToken(refreshToken string, expired int64) (RefreshTokenRes, error)
Click to show internal directories.
Click to hide internal directories.