core

package
v0.0.0-...-fcfe891 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildID = "dev"
View Source
var Version = "master"

Functions

This section is empty.

Types

type OAuth

type OAuth struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	Error        string
}

func GetOauthAccessToken

func GetOauthAccessToken(code string, redirectUri string, clientId string, clientSecret string) (*OAuth, error)

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session represents an active Spotify connection

func Login

func Login(username string, password string, deviceName string) (*Session, error)

Login to Spotify using username and password

func LoginDiscovery

func LoginDiscovery(cacheBlobPath string, deviceName string) (*Session, error)

Registers librespot as a Spotify Connect device via mdns. When user connects, logs on to Spotify and saves credentials in file at cacheBlobPath. Once saved, the blob credentials allow the program to connect to other Spotify Connect devices and control them.

func LoginDiscoveryBlob

func LoginDiscoveryBlob(username string, blob string, deviceName string) (*Session, error)

Login using an authentication blob through Spotify Connect discovery system, reading an existing blob data. To read from a file, see LoginDiscoveryBlobFile.

func LoginDiscoveryBlobFile

func LoginDiscoveryBlobFile(cacheBlobPath, deviceName string) (*Session, error)

Login from credentials at cacheBlobPath previously saved by LoginDiscovery. Similar to LoginDiscoveryBlob, except it reads it directly from a file.

func LoginOAuth

func LoginOAuth(deviceName string, clientId string, clientSecret string) (*Session, error)

Login to Spotify using the OAuth method

func LoginSaved

func LoginSaved(username string, authData []byte, deviceName string) (*Session, error)

Login to Spotify using an existing authData blob

func (*Session) Country

func (s *Session) Country() string

func (*Session) DeviceId

func (s *Session) DeviceId() string

func (*Session) Discovery

func (s *Session) Discovery() *discovery.Discovery

func (*Session) Mercury

func (s *Session) Mercury() *mercury.Client

func (*Session) Player

func (s *Session) Player() *player.Player

func (*Session) ReusableAuthBlob

func (s *Session) ReusableAuthBlob() []byte

func (*Session) Stream

func (s *Session) Stream() connection.PacketStream

func (*Session) Username

func (s *Session) Username() string

Jump to

Keyboard shortcuts

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