spotify

package
v0.0.0-...-807dce9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAuthUri

func BuildAuthUri(userId uint) string

func GetAuthUrl

func GetAuthUrl(c echo.Context) error

func RegisterRefreshToken

func RegisterRefreshToken(context echo.Context) error

Types

type Album

type Album struct {
	Artists []Artist `json:"artists"`
	Name    string   `json:"name"`
	Uri     string   `json:"uri"`
}

type Artist

type Artist struct {
	Name string `json:"name"`
	Id   string `json:"id"`
	Uri  string `json:"uri"`
}

type Connector

type Connector struct {
	AccessToken  string
	RefreshToken string
	RetryAmount  int8
}

func (*Connector) GetCurrentTrack

func (spotify *Connector) GetCurrentTrack() (Player, error)

type ErrorCode

type ErrorCode int8
const (
	NotPlaying ErrorCode = 1
)

type Player

type Player struct {
	ProgressMs int64 `json:"progress_ms"`
	Item       Track `json:"item"`
}

func (*Player) Copy

func (player *Player) Copy() Player

type RegisterTokenRequest

type RegisterTokenRequest struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    uint32 `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type Track

type Track struct {
	Name    string   `json:"name"`
	Id      string   `json:"id"`
	Uri     string   `json:"uri"`
	Artists []Artist `json:"artists"`
	Album   Album    `json:"album"`
}

func (*Track) Copy

func (track *Track) Copy() Track

type TrackError

type TrackError struct {
	Code ErrorCode
	// contains filtered or unexported fields
}

func (*TrackError) Error

func (err *TrackError) Error() string

Jump to

Keyboard shortcuts

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