Documentation ¶
Index ¶
- func NewPlayback(client SpotifyClient, playerStateChanges chan *web.WebPlaybackState, ...) currentlyPlaying
- func NewSearchResults(client SpotifyClient, name string) searchResultsInterface
- func StartRemoteAuthentication(authenticator web.SpotifyAuthenticatorInterface, state string) error
- type AlbumList
- type DebugClient
- func (fc DebugClient) CurrentUser() (*spotify.PrivateUser, error)
- func (fc DebugClient) Next() error
- func (fc DebugClient) Pause() error
- func (fc DebugClient) PlayerCurrentlyPlaying() (*spotify.CurrentlyPlaying, error)
- func (fc DebugClient) PlayerDevices() ([]spotify.PlayerDevice, error)
- func (fc DebugClient) Previous() error
- func (fc DebugClient) Token() (*oauth2.Token, error)
- func (fc DebugClient) TransferPlayback(id spotify.ID, play bool) error
- type DebugPlayer
- type DebugSearcher
- type DebugUserAlbumFetcher
- type DevicesTable
- type Playback
- type Player
- type Search
- type Searcher
- type SideBar
- type SpotifyClient
- type URIName
- type UserAlbumFetcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPlayback ¶
func NewPlayback(client SpotifyClient, playerStateChanges chan *web.WebPlaybackState, webPlayerID spotify.ID) currentlyPlaying
NewPlayback creates data structure representing current spotify playback.
func NewSearchResults ¶
func NewSearchResults(client SpotifyClient, name string) searchResultsInterface
func StartRemoteAuthentication ¶
func StartRemoteAuthentication(authenticator web.SpotifyAuthenticatorInterface, state string) error
StartRemoteAuthentication redirects to spotify's API in order to authenticate user
Types ¶
type AlbumList ¶
AlbumList represents list of albums with underlying data, table to display, box in which table is places, indexes pointing to currently playing item, and last chosen items.
type DebugClient ¶
type DebugClient struct { Player Searcher UserAlbumFetcher }
DebugClient is a dummy struct used when running in debug mode
func (DebugClient) CurrentUser ¶
func (fc DebugClient) CurrentUser() (*spotify.PrivateUser, error)
CurrentUser is a dummy implementation used when running in debug mode
func (DebugClient) Next ¶
func (fc DebugClient) Next() error
Next is a dummy implementation used when running in debug mode
func (DebugClient) Pause ¶
func (fc DebugClient) Pause() error
Pause is a dummy implementation used when running in debug mode
func (DebugClient) PlayerCurrentlyPlaying ¶
func (fc DebugClient) PlayerCurrentlyPlaying() (*spotify.CurrentlyPlaying, error)
PlayerCurrentlyPlaying is a dummy implementation used when running in debug mode
func (DebugClient) PlayerDevices ¶
func (fc DebugClient) PlayerDevices() ([]spotify.PlayerDevice, error)
PlayerDevices is a dummy implementation used when running in debug mode
func (DebugClient) Previous ¶
func (fc DebugClient) Previous() error
Previous is a dummy implementation used when running in debug mode
func (DebugClient) Token ¶
func (fc DebugClient) Token() (*oauth2.Token, error)
Token is a dummy implementation used when running in debug mode
func (DebugClient) TransferPlayback ¶
func (fc DebugClient) TransferPlayback(id spotify.ID, play bool) error
TransferPlayback is a dummy implementation used when running in debug mode
type DebugPlayer ¶
type DebugPlayer struct { }
func (DebugPlayer) Play ¶
func (dp DebugPlayer) Play() error
Play is a dummy implementation used when running in debug mode
func (DebugPlayer) PlayOpt ¶
func (dp DebugPlayer) PlayOpt(opt *spotify.PlayOptions) error
PlayOpt is a dummy implementation used when running in debug mode
type DebugSearcher ¶
type DebugSearcher struct{}
func (DebugSearcher) Search ¶
func (ds DebugSearcher) Search(query string, t spotify.SearchType) (*spotify.SearchResult, error)
Search is a dummy implementation used when running in debug mode
type DebugUserAlbumFetcher ¶
type DebugUserAlbumFetcher struct{}
func (DebugUserAlbumFetcher) CurrentUsersAlbumsOpt ¶
func (debugFetcher DebugUserAlbumFetcher) CurrentUsersAlbumsOpt(options *spotify.Options) (*spotify.SavedAlbumPage, error)
CurrentUsersAlbumsOpt is a dummy implementation used when running in debug mode
type DevicesTable ¶
type DevicesTable struct { Table *tui.Table // contains filtered or unexported fields }
type Playback ¶
type Playback struct { Previous *tui.Button Next *tui.Button Stop *tui.Button Play *tui.Button Box *tui.Box }
type Search ¶
type Search struct { Focusables []tui.Widget Box *tui.Box }
func NewSearch ¶
func NewSearch(client SpotifyClient) *Search
NewSearch creates data structure which represent search input with search results.
type Searcher ¶
type Searcher interface {
Search(string, spotify.SearchType) (*spotify.SearchResult, error)
}
type SideBar ¶
SideBar represents box with album list inside this box.
func NewSideBar ¶
func NewSideBar(client SpotifyClient) (*SideBar, error)
NewSideBar creates struct which holds references to SideBar Box and AlbumList placed inside SideBar
type SpotifyClient ¶
type SpotifyClient interface { UserAlbumFetcher Player Searcher Pause() error Previous() error Next() error PlayerCurrentlyPlaying() (*spotify.CurrentlyPlaying, error) PlayerDevices() ([]spotify.PlayerDevice, error) TransferPlayback(spotify.ID, bool) error }
SpotifyClient is a wrapper interface around spotify.client used in order to improve testability of the code.
func NewDebugClient ¶
func NewDebugClient() SpotifyClient
NewDebugClient returns Client which can be used in debug mode or in tests, It does not communicate with Spotify API.
type UserAlbumFetcher ¶
type UserAlbumFetcher interface {
CurrentUsersAlbumsOpt(opt *spotify.Options) (*spotify.SavedAlbumPage, error)
}