spotify

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(code string) (*oauth2.Token, error)

func Configure

func Configure(c *config.ConfigMap) error

Types

type ExplicitContent

type ExplicitContent struct {
	FilterEnabled bool `json:"filter_enabled"`
	FilterLocked  bool `json:"filter_locked"`
}

type JsonConfig

type JsonConfig struct {
	Web struct {
		ClientId     string `json:"client_id"`
		ClientSecret string `json:"client_secret"`
		RedirectUri  string `json:"redirect_uri"`
		AuthUri      string `json:"auth_uri"`
		TokenUri     string `json:"token_uri"`
	} `json:"web"`
}

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
}

func RefreshToken

func RefreshToken(refreshToken string) (*Token, error)

type User

type User struct {
	Id           string   `json:"id"`
	DisplayName  string   `json:"display_name"`
	Email        string   `json:"email"`
	Country      string   `json:"country"`
	Href         string   `json:"href"`
	Images       []string `json:"images"`
	Product      string   `json:"product"`
	Type         string   `json:"type"`
	Uri          string   `json:"uri"`
	ExternalUrls struct {
		Spotify string `json:"spotify"`
	} `json:"external_urls"`
	Followers struct {
		Href  string `json:"href"`
		Total int    `json:"total"`
	}
}

func GetUserByToken

func GetUserByToken(token *oauth2.Token) (*User, error)

func (*User) GetAvatar

func (u *User) GetAvatar() string

func (*User) GetEmailAddress

func (u *User) GetEmailAddress() string

func (*User) GetFullname

func (u *User) GetFullname() string

func (*User) GetUserId

func (u *User) GetUserId() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL