Documentation ¶
Overview ¶
Package cursor defines types for constructing play cursors.
Index ¶
Constants ¶
View Source
const ( ActionSet Action = "set" ActionNext = "next" ActionPrevious = "previous" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct { sync.Mutex // protects Current, Next and Previous Current Position `json:"current"` Next Position `json:"next"` Previous Position `json:"previous"` // contains filtered or unexported fields }
Cursor is a moveable marker on a playlist.
func NewCursor ¶
func NewCursor(p *playlist.Playlist, c index.Collection) *Cursor
NewCursor creates a new Cursor for the playlist.Playlist using the index.Collection as the source of tracks.
func (*Cursor) Backward ¶
Backward moves the cursor backwards. Returns an error if the previous track could not be found, and sets the Previous item to be empty.
type RepAction ¶
type Store ¶
type Store interface { // Get returns the cursor for the given name. Get(name string) *Cursor // Set sets the cursor for the given name. Set(name string, p *Cursor) error // Delete removes the cursor with the given name. Delete(name string) error }
Store is an interface which defines methods for implementing a cursor store.
Click to show internal directories.
Click to hide internal directories.