chubby

package module
v0.0.0-...-5c82916 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: GPL-3.0 Imports: 9 Imported by: 3

README

README
    chubby is a Chub client library for Go language.

AUTHORS
    Viacheslav Chimishuk <vchimishuk@yandex.ru>

COPYING
    This programm is released under the GNU General Public License version 3 or
    later, which is distributed in the COPYING file. You should have received a
    copy of the GNU General Public License along with this program.  If not,
    see <http://www.gnu.org/licenses/>.

Documentation

Index

Constants

View Source
const (
	VolumeModeAbs = false
	VolumeModeRel = true
)

Variables

View Source
var ErrNotConnected = errors.New("not connected")

Functions

func IsServerError

func IsServerError(err error) bool

Types

type Chubby

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

func (*Chubby) Close

func (c *Chubby) Close() error

func (*Chubby) Connect

func (c *Chubby) Connect(host string, port int) error

func (*Chubby) Connected

func (c *Chubby) Connected() bool

func (*Chubby) CreatePlaylist

func (c *Chubby) CreatePlaylist(name string) error

func (*Chubby) DeletePlaylist

func (c *Chubby) DeletePlaylist(name string) error

func (*Chubby) Events

func (c *Chubby) Events(enable bool) (<-chan Event, error)

func (*Chubby) Kill

func (c *Chubby) Kill() error

func (*Chubby) List

func (c *Chubby) List(path string) ([]Entry, error)

func (*Chubby) Next

func (c *Chubby) Next() error

func (*Chubby) Pause

func (c *Chubby) Pause() error

func (*Chubby) Ping

func (c *Chubby) Ping() error

func (*Chubby) Play

func (c *Chubby) Play(pth string) error

func (*Chubby) Playlists

func (c *Chubby) Playlists() ([]*Playlist, error)

func (*Chubby) Prev

func (c *Chubby) Prev() error

func (*Chubby) RenamePlaylist

func (c *Chubby) RenamePlaylist(from, to string) error

func (*Chubby) Seek

func (c *Chubby) Seek(time time.Time, mode SeekMode) error

func (*Chubby) Status

func (c *Chubby) Status() (*Status, error)

func (*Chubby) Stop

func (c *Chubby) Stop() error

func (*Chubby) Volume

func (c *Chubby) Volume(vol int, mode VolumeMode) error

type CreatePlaylistEvent

type CreatePlaylistEvent struct {
	Name string
	// contains filtered or unexported fields
}

func (*CreatePlaylistEvent) Event

func (e *CreatePlaylistEvent) Event() string

func (*CreatePlaylistEvent) Serialize

func (e *CreatePlaylistEvent) Serialize() string

type DeletePlaylistEvent

type DeletePlaylistEvent struct {
	Name string
	// contains filtered or unexported fields
}

func (*DeletePlaylistEvent) Event

func (e *DeletePlaylistEvent) Event() string

func (*DeletePlaylistEvent) Serialize

func (e *DeletePlaylistEvent) Serialize() string

type Dir

type Dir struct {
	Path string
	Name string
}

func (*Dir) Dir

func (d *Dir) Dir() *Dir

func (*Dir) IsDir

func (d *Dir) IsDir() bool

func (*Dir) Track

func (d *Dir) Track() *Track

type Entry

type Entry interface {
	IsDir() bool
	Dir() *Dir
	Track() *Track
}

type Event

type Event interface {
	Event() string
	Serialize() string
}

type Playlist

type Playlist struct {
	Name     string
	Duration time.Time
	Length   int
}

type SeekMode

type SeekMode int
const (
	SeekModeAbs SeekMode = iota
	SeekModeBackward
	SeekModeForward
)

type ServerError

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

func (ServerError) Error

func (e ServerError) Error() string

type State

type State string
const (
	StatePaused  State = "paused"
	StatePlaying State = "playing"
	StateStopped State = "stopped"
)

type Status

type Status struct {
	State       State
	Volume      int
	PlaylistPos int
	TrackPos    time.Time
	Playlist    *Playlist
	Track       *Track
}

type StatusEvent

type StatusEvent struct {
	State       State
	Volume      int
	PlaylistPos int
	TrackPos    time.Time
	Playlist    *Playlist
	Track       *Track
	// contains filtered or unexported fields
}

func (*StatusEvent) Event

func (e *StatusEvent) Event() string

func (*StatusEvent) Serialize

func (e *StatusEvent) Serialize() string

type Track

type Track struct {
	Path   string
	Artist string
	Album  string
	Year   int
	Title  string
	Number int
	Length time.Time
}

func (*Track) Dir

func (t *Track) Dir() *Dir

func (*Track) IsDir

func (t *Track) IsDir() bool

func (*Track) Track

func (t *Track) Track() *Track

type VolumeMode

type VolumeMode bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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