session

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOAuth2Server

func NewOAuth2Server(ctx context.Context, callbackPort int) (int, chan string, error)

Types

type BlobCredentials

type BlobCredentials struct {
	Username string
	Blob     []byte
}

type InteractiveCredentials

type InteractiveCredentials struct {
	CallbackPort int
}

type Options

type Options struct {
	// DeviceType is the Spotify showed device type, required.
	DeviceType devicespb.DeviceType
	// DeviceId is the Spotify device ID, required.
	DeviceId string
	// Credentials is the credentials to be used for authentication, required.
	Credentials any

	// ClientToken is the Spotify client token, leave empty to let the server generate one.
	ClientToken string
	// Resolver is an instance of apresolve.ApResolver, leave nil to use the default one.
	Resolver *apresolve.ApResolver
}

type Session

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

func NewSessionFromOptions

func NewSessionFromOptions(opts *Options) (*Session, error)

func (*Session) Accesspoint

func (s *Session) Accesspoint() *ap.Accesspoint

func (*Session) AudioKey

func (s *Session) AudioKey() *audio.KeyProvider

func (*Session) Close

func (s *Session) Close()

func (*Session) Dealer

func (s *Session) Dealer() *dealer.Dealer

func (*Session) Spclient

func (s *Session) Spclient() *spclient.Spclient

func (*Session) StoredCredentials

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

func (*Session) Username

func (s *Session) Username() string

func (*Session) WebApi

func (s *Session) WebApi(method string, path string, query url.Values, header http.Header, body []byte) (*http.Response, error)

type SpotifyTokenCredentials

type SpotifyTokenCredentials struct {
	Username string
	Token    string
}

type StoredCredentials

type StoredCredentials struct {
	Username string
	Data     []byte
}

Jump to

Keyboard shortcuts

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