protocol

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() map[string]Params

func ParseID

func ParseID(id string) (path string, num int, err error)

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(string) (*codec.SongInfo, error)
	// GetSong returns a playable song.
	GetSong(string) (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[string]*codec.SongInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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