mercury

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(Response)

type Client

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

func CreateMercury

func CreateMercury(stream connection.PacketStream) *Client

CreateMercury initializes a Connection for the specified session.

func (*Client) GetAlbum

func (m *Client) GetAlbum(id string) (*Spotify.Album, error)

func (*Client) GetArtist

func (m *Client) GetArtist(id string) (*Spotify.Artist, error)

func (*Client) GetPlaylist

func (m *Client) GetPlaylist(id string) (*Spotify.SelectedListContent, error)

func (*Client) GetRootPlaylist

func (m *Client) GetRootPlaylist(username string) (*Spotify.SelectedListContent, error)

func (*Client) GetToken

func (m *Client) GetToken(clientId string, scopes string) (*metadata.Token, error)

func (*Client) GetTrack

func (m *Client) GetTrack(id string) (*Spotify.Track, error)

func (*Client) Handle

func (m *Client) Handle(cmd uint8, reader io.Reader) (err error)

func (*Client) NextSeq

func (m *Client) NextSeq() []byte

func (*Client) NextSeqWithInt

func (m *Client) NextSeqWithInt() (uint32, []byte)

func (*Client) Request

func (m *Client) Request(req Request, cb Callback) (err error)

func (*Client) Search

func (m *Client) Search(search string, limit int, country string, username string) (*metadata.SearchResponse, error)

func (*Client) Subscribe

func (m *Client) Subscribe(uri string, recv chan Response, cb Callback) error

Subscribe subscribes the specified receiving channel to the specified URI, and calls the callback function whenever there's an event happening.

func (*Client) Suggest

func (m *Client) Suggest(search string) (*metadata.SuggestResult, error)

type Connection

type Connection interface {
	Subscribe(uri string, recv chan Response, cb Callback) error
	Request(req Request, cb Callback) (err error)
	Handle(cmd uint8, reader io.Reader) (err error)
}

type Internal

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

func (*Internal) NextSeq

func (m *Internal) NextSeq() (uint32, []byte)

type Pending

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

type Request

type Request struct {
	Method      string
	Uri         string
	ContentType string
	Payload     [][]byte
}

type Response

type Response struct {
	HeaderData []byte
	Uri        string
	Payload    [][]byte
	StatusCode int32
	SeqKey     string
}

func (*Response) CombinePayload

func (res *Response) CombinePayload() []byte

Jump to

Keyboard shortcuts

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