proto

package
v0.0.0-...-f8832d1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Create new playlist.
	CreatePlaylist = "create-playlist"
	// Delete existing playlist.
	DeletePlaylist = "delete-playlist"
	// Enable or disable events notification for the current connection.
	Events = "events"
	// Stop the server.
	Kill = "kill"
	// Show directory contents.
	List = "list"
	// Play next track in the current playing playlist.
	Next = "next"
	// Toggle paused state.
	Pause = "pause"
	// Do nothing, just returns "OK" response.
	Ping = "ping"
	// Play a path (track or directory) from VFS.
	Play = "play"
	// Add new track or folder to the end of the playlist.
	PlaylistAppend = "playlist-append"
	// Remove all items from playlist.
	PlaylistClear = "playlist-clear"
	// Delete items from playlist.
	PlaylistDelete = "playlist-delete"
	// Show playlist tracks.
	PlaylistList = "playlist-list"
	// Start playing given playlist.
	PlaylistPlay = "playlist-play"
	// Move items inside playlist.
	PlaylistRemove = "playlist-move"
	// Rename playlist.
	PlaylistRename = "rename-playlist"
	// Show existing playlists list.
	Playlists = "playlists"
	// Play previous track in the current playling playlist.
	Prev = "prev"
	// Disconnect from server.
	Quit = "quit"
	// Set/toggle repeat mode.
	Repeat = "repeat"
	// Returns player's current state (playback status, volume, etc.).
	Status = "status"
	// Seek current playing track time to specified time offset.
	Seek = "seek"
	// Stop playing if active.
	Stop = "stop"
	// Change volume level.
	Volumn = "volume"
)

Variables

This section is empty.

Functions

func IsError

func IsError(err error) bool

Types

type Command

type Command struct {
	Name string
	Args []interface{}
}

func ParseCommand

func ParseCommand(str string) (*Command, error)

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type Proto

type Proto struct {
	// contains filtered or unexported fields
}

func New

func New(conn net.Conn) *Proto

func (*Proto) Close

func (p *Proto) Close() error

func (*Proto) ReadCommand

func (p *Proto) ReadCommand() (*Command, error)

func (*Proto) WriteError

func (p *Proto) WriteError(e error) error

func (*Proto) WriteEvent

func (p *Proto) WriteEvent(name string,
	records []serialize.Serializable) error

func (*Proto) WriteResponse

func (p *Proto) WriteResponse(records []serialize.Serializable) error

Jump to

Keyboard shortcuts

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