protocol

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2016 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() map[string]Params

func Map added in v0.1.0

func Map() map[string]map[string]Instance

func Register

func Register(name string, params []string, newInstance func([]string, *oauth2.Token) (Instance, error), instType reflect.Type)

func RegisterOAuth

func RegisterOAuth(name string, config *oauth2.Config, newInstance func([]string, *oauth2.Token) (Instance, error), instType reflect.Type)

Types

type Instance

type Instance interface {
	// Key returns a unique identifier for the instance.
	Key() string
	// List returns the list of available songs, possibly cached.
	List() (SongList, error)
	// Refresh forces an update of the song list.
	Refresh() (SongList, error)
	// Info returns information about one song.
	Info(codec.ID) (*codec.SongInfo, error)
	// GetSong returns a playable song.
	GetSong(codec.ID) (codec.Song, error)
}

type Params

type Params struct {
	Params   []string `json:",omitempty"`
	OAuthURL string   `json:",omitempty"`
}

type Protocol

type Protocol struct {
	*Params
	OAuth *oauth2.Config
	// contains filtered or unexported fields
}

func ByName

func ByName(name string) (*Protocol, error)

func (*Protocol) Decode added in v0.1.0

func (p *Protocol) Decode(r io.Reader) (Instance, error)

func (*Protocol) NewInstance

func (p *Protocol) NewInstance(params []string, token *oauth2.Token) (Instance, error)

type SongList

type SongList map[codec.ID]*codec.SongInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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