protocol

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2015 License: ISC Imports: 3 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() map[string]Params

func Register

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

func RegisterOAuth

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

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) 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