spotifyhelper

package
v0.0.0-...-4a4d2a2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Play()
	Pause()
	Toggle()
	NextSong()
	PrevSong()
	PlaySong(song string)
	PlayPlaylist(playlist string)
	Token() oauth2.Token
	Ready() <-chan struct{}
}

Controller contains valid spotify actions

func New

func New(ctx context.Context, s *Session, health healthcheck.Handler) Controller

New creates a new spotify controller from a session

type Session

type Session struct {
	Init <-chan struct{}
	// contains filtered or unexported fields
}

Session contains a spotify session with oauth handler

func NewSession

func NewSession(ctx context.Context, clientID, secretKey, redirectURL string) *Session

NewSession creates a new session

func (*Session) Handler

func (s *Session) Handler() http.HandlerFunc

Handler returns http handler for oauth tokens

func (*Session) LoginURL

func (s *Session) LoginURL() string

LoginURL returns a login url for spotify user login

func (*Session) SetToken

func (s *Session) SetToken(token oauth2.Token)

SetToken allows an external token to be loaded

Jump to

Keyboard shortcuts

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