Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StartNewSession func(ctx *SessionContext) (Session, error)
Forward declared method to create a new Spotify 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, MediaAsset.OnStart(Ctx().Context) will be called on the returned MediaAsset. // This is for convenience but not desirable when the asset is in a time-to-live cache, for example. StartInternally bool }
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 access ("pinning") with the given spotify track ID or URI PinTrack(trackID string, opts PinOpts) (amp.MediaAsset, 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 left 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
type SessionInfo ¶
Click to show internal directories.
Click to hide internal directories.