api

package
v0.0.0-...-40e63e7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package api provides data model interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Authenticate sets an OAuth2 token that should be used for Spotify calls.
	Authenticate(token *oauth2.Token) error

	// Changed notifies the program that some internal state has changed.
	Changed(typ ChangeType, data interface{})

	// Clipboards is a list of clipboards.
	Clipboards() *clipboard.List

	// Db returns the database of lists.
	Db() *db.List

	// Exec executes a command through the command-line interface.
	Exec(string) error

	// History returns a list with all tracks played back during the current session.
	History() list.List

	// Return the global multibar instance.
	Multibar() *multibar.Multibar

	// Library returns a list of entry points to the Spotify library.
	Library() *spotify_library.List

	// List returns the active list.
	List() list.List

	// PlayerStatus returns the current MPD player status.
	PlayerStatus() player.State

	// Quit shuts down PMS.
	Quit()

	// Sequencer returns a pointer to the key sequencer that receives key events.
	Sequencer() *keys.Sequencer

	// SetList sets the active list.
	SetList(list.List)

	// Spotify returns a Spotify client.
	Spotify() (*spotify.Client, error)

	// Styles returns the current stylesheet.
	Styles() style.Stylesheet

	// UI returns the global UI object.
	UI() UI
}

API defines a set of commands that should be available to commands run through the command-line interface.

type ChangeType

type ChangeType int
const (
	ChangeNone               ChangeType = iota // noop
	ChangeList                                 // some list has changes in row data, title, or other
	ChangeOption                               // a setting has been changed
	ChangePlayerStateInvalid                   // player state is no longer valid due to a server command
	ChangeDevice                               // playback device changed
)

type Collection

type Collection interface {
	ActivateIndex(int) error
	Index() (int, error)
	Len() int
	Remove(int) error
	ValidIndex(int) bool
}

type MockAPI

type MockAPI struct {
	mock.Mock
}

MockAPI is an autogenerated mock type for the API type

func (*MockAPI) Authenticate

func (_m *MockAPI) Authenticate(token *oauth2.Token) error

Authenticate provides a mock function with given fields: token

func (*MockAPI) Changed

func (_m *MockAPI) Changed(typ ChangeType, data interface{})

Changed provides a mock function with given fields: typ, data

func (*MockAPI) Clipboards

func (_m *MockAPI) Clipboards() *clipboard.List

Clipboards provides a mock function with given fields:

func (*MockAPI) Db

func (_m *MockAPI) Db() *db.List

Db provides a mock function with given fields:

func (*MockAPI) Exec

func (_m *MockAPI) Exec(_a0 string) error

Exec provides a mock function with given fields: _a0

func (*MockAPI) History

func (_m *MockAPI) History() list.List

History provides a mock function with given fields:

func (*MockAPI) Library

func (_m *MockAPI) Library() *spotify_library.List

Library provides a mock function with given fields:

func (*MockAPI) List

func (_m *MockAPI) List() list.List

List provides a mock function with given fields:

func (*MockAPI) Multibar

func (_m *MockAPI) Multibar() *multibar.Multibar

Multibar provides a mock function with given fields:

func (*MockAPI) PlayerStatus

func (_m *MockAPI) PlayerStatus() player.State

PlayerStatus provides a mock function with given fields:

func (*MockAPI) Quit

func (_m *MockAPI) Quit()

Quit provides a mock function with given fields:

func (*MockAPI) Sequencer

func (_m *MockAPI) Sequencer() *keys.Sequencer

Sequencer provides a mock function with given fields:

func (*MockAPI) SetList

func (_m *MockAPI) SetList(_a0 list.List)

SetList provides a mock function with given fields: _a0

func (*MockAPI) Spotify

func (_m *MockAPI) Spotify() (*spotify.Client, error)

Spotify provides a mock function with given fields:

func (*MockAPI) Styles

func (_m *MockAPI) Styles() style.Stylesheet

Styles provides a mock function with given fields:

func (*MockAPI) UI

func (_m *MockAPI) UI() UI

UI provides a mock function with given fields:

type MockCollection

type MockCollection struct {
	mock.Mock
}

MockCollection is an autogenerated mock type for the Collection type

func (*MockCollection) ActivateIndex

func (_m *MockCollection) ActivateIndex(_a0 int) error

ActivateIndex provides a mock function with given fields: _a0

func (*MockCollection) Index

func (_m *MockCollection) Index() (int, error)

Index provides a mock function with given fields:

func (*MockCollection) Len

func (_m *MockCollection) Len() int

Len provides a mock function with given fields:

func (*MockCollection) Remove

func (_m *MockCollection) Remove(_a0 int) error

Remove provides a mock function with given fields: _a0

func (*MockCollection) ValidIndex

func (_m *MockCollection) ValidIndex(_a0 int) bool

ValidIndex provides a mock function with given fields: _a0

type MockOptions

type MockOptions struct {
	mock.Mock
}

MockOptions is an autogenerated mock type for the Options type

func (*MockOptions) AllKeys

func (_m *MockOptions) AllKeys() []string

AllKeys provides a mock function with given fields:

func (*MockOptions) Get

func (_m *MockOptions) Get(_a0 string) interface{}

Get provides a mock function with given fields: _a0

func (*MockOptions) GetBool

func (_m *MockOptions) GetBool(_a0 string) bool

GetBool provides a mock function with given fields: _a0

func (*MockOptions) GetInt

func (_m *MockOptions) GetInt(_a0 string) int

GetInt provides a mock function with given fields: _a0

func (*MockOptions) GetString

func (_m *MockOptions) GetString(_a0 string) string

GetString provides a mock function with given fields: _a0

func (*MockOptions) Set

func (_m *MockOptions) Set(_a0 string, _a1 interface{})

Set provides a mock function with given fields: _a0, _a1

type MockTableWidget

type MockTableWidget struct {
	mock.Mock
}

MockTableWidget is an autogenerated mock type for the TableWidget type

func (*MockTableWidget) ColumnNames

func (_m *MockTableWidget) ColumnNames() []string

ColumnNames provides a mock function with given fields:

func (*MockTableWidget) GetVisibleBoundaries

func (_m *MockTableWidget) GetVisibleBoundaries() (int, int)

GetVisibleBoundaries provides a mock function with given fields:

func (*MockTableWidget) List

func (_m *MockTableWidget) List() list.List

List provides a mock function with given fields:

func (*MockTableWidget) PositionReadout

func (_m *MockTableWidget) PositionReadout() string

PositionReadout provides a mock function with given fields:

func (*MockTableWidget) ScrollViewport

func (_m *MockTableWidget) ScrollViewport(_a0 int, _a1 bool)

ScrollViewport provides a mock function with given fields: _a0, _a1

func (*MockTableWidget) SetColumns

func (_m *MockTableWidget) SetColumns(_a0 []string)

SetColumns provides a mock function with given fields: _a0

func (*MockTableWidget) SetList

func (_m *MockTableWidget) SetList(_a0 list.List)

SetList provides a mock function with given fields: _a0

func (*MockTableWidget) Size

func (_m *MockTableWidget) Size() (int, int)

Size provides a mock function with given fields:

type MockUI

type MockUI struct {
	mock.Mock
}

MockUI is an autogenerated mock type for the UI type

func (*MockUI) Refresh

func (_m *MockUI) Refresh()

Refresh provides a mock function with given fields:

func (*MockUI) TableWidget

func (_m *MockUI) TableWidget() TableWidget

TableWidget provides a mock function with given fields:

type Options

type Options interface {
	AllKeys() []string
	Set(string, interface{})
	Get(string) interface{}
	GetString(string) string
	GetInt(string) int
	GetBool(string) bool
}

type TableWidget

type TableWidget interface {
	ColumnNames() []string
	GetVisibleBoundaries() (int, int)
	List() list.List
	PositionReadout() string
	ScrollViewport(int, bool)
	SetColumns([]string)
	SetList(list.List)
	Size() (int, int)
}

type UI

type UI interface {
	Refresh()
	TableWidget() TableWidget
}

Jump to

Keyboard shortcuts

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