Documentation
¶
Overview ¶
Package playlist defines functionality for creating, manipulating and persisting playlists.
Index ¶
Constants ¶
const ( ActionCreate Action = "create" ActionDelete = "delete" ActionAddItem = "addItem" ActionRemoveItem = "deleteItem" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a type which defines a playlist item.
func (*Item) AddTransform ¶
func (i *Item) AddTransform(t Transformer)
AddTransform adds the Transformer to the Item.
func (*Item) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Item) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Playlist ¶
type Playlist struct {
// contains filtered or unexported fields
}
Playlist is a basic implementation of a playlist
func (*Playlist) Items ¶
Items returns a slice of *Item instances which represent each item in the playlist.
func (*Playlist) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Playlist) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type RemovePath ¶
RemovePath is a type which defines a RemovePath action for a specific index.Path, which removes a path from a playlist item.
func (RemovePath) MarshalJSON ¶
func (r RemovePath) MarshalJSON() ([]byte, error)
Implements json.Marshaler.
type RepAction ¶
type Store ¶
type Store interface { // Names returns the name of playlists in the store. Names() []string // Get returns the playlist for the given name. Get(name string) *Playlist // Set sets the playlist for the given name. Set(name string, p *Playlist) error // Delete removes the playlist with the given name. Delete(name string) error }
Store is an interface which defines methods for implementing a playlist store.
type Transformer ¶
type Transformer interface { // Transform returns the action associated with the transformation. Transform() string }
Transformer is an interface which defines the Transform method for making changes to playlist items.