Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StartNewSession func(ctx *SessionContext) (Session, error)
Forward declartion to create a respot.Session.
Functions ¶
func GenerateDeviceUID ¶
Types ¶
type APList ¶
type APList struct {
ApList []string `json:"ap_list"`
}
APList is the JSON structure corresponding to the output of the AP endpoint resolve API
type PinOpts ¶
type PinOpts struct { // If set, media.Asset.OnStart(Ctx().Context) will be called on the returned media.Asset. // This is for convenience but not desirable when the asset is in a time-to-live cache, for example. StartInternally bool // Expresses preferences for the requested asset's codec and format. Format asset.AssetFormat }
type Session ¶
type Session interface { Close() error // Returns the SessionContext current in use by this session Context() *SessionContext // Initiates login with params contained in Ctx.Login Login() error Search(query string, limit int) (*mercury.SearchResponse, error) Mercury() *mercury.Client // Initiates downloading ("pinning") with the given spotify track ID or URI. // The track data is accessible via media.Asset, supporting io.ReadSeekCloser and is essential for streaming or serving. PinTrack(trackID string, opts PinOpts) (media.Asset, error) }
type SessionContext ¶
type SessionContext struct { task.Context // logging & shutdown Login SessionLogin // means for the session to login Info SessionInfo // filled in during Session.Login() Keys crypto.Keys // If nil, will be auto-generated DeviceName string // Label of the device being used DeviceUID string // if nil, auto-generated from DeviceName }
func DefaultSessionContext ¶
func DefaultSessionContext(deviceLabel string) *SessionContext
DefaultSessionContext creates a SessionContext with the given device label.
type SessionInfo ¶
Click to show internal directories.
Click to hide internal directories.