interfaces

package
v0.0.0-...-d2e9830 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Aliases() []string
	Description() string
	IsAdminCommand() bool
	Execute(user *gumble.User, args ...string) (string, bool, error)
}

Command is an interface that all commands must implement.

type Ohohoho

type Ohohoho interface {
	IsInterrupting() bool
	Stop() error
	EmptyStop() error
	PlaySample(sampleName string, howMany int) error
}

Ohohoho is an interface that all commands must implement.

type Player

type Player interface {
	Skip()
	SkipPlaylist()
	PlayCurrentForeverLoop(context.Context)
	CurrentTrack() (Track, error)
	HoldOnTrack() error
	PauseCurrent() error
	ResumeCurrent()
	StopCurrent() error
	RepeatMode() bool
}

Player is the interface which should be used to interact with audio player goroutine.

type Playlist

type Playlist interface {
	GetID() string
	GetTitle() string
	GetSubmitter() string
	GetService() string
}

Playlist is an interface of methods that must be implemented by playlists.

type Queue

type Queue interface {
	Length() int
	Reset()
	AppendTrack(Track) error
	PrependTrack(Track) error
	InsertTrack(int, Track) error
	GetTrack(int) Track
	GetTrackNoWait(index int) Track
	PeekNextTrack() (Track, error)
	RemoveTrack(int) Track
	RemoveTrackIf(func(int, Track) bool) int
	Traverse(func(int, Track))
	ShuffleTracks()
	RandomNextTrack(bool)
}

Queue is the interface which should be interacted with for queue operations. Using the Queue interface ensures thread safety.

type Service

type Service interface {
	GetReadableName() string
	GetFormat() string
	CheckAPIKey() error
	CheckURL(string) bool
	// GetTracks should for given url return list of tracks, nil or nil, error message
	GetTracks(string, *gumble.User) ([]Track, error)
	// SearchTracks should for given search query return `track, nil` or `empty track, error message`
	SearchTrack(string, *gumble.User) (Track, error)
}

Service is an interface of methods to be implemented by various service types, such as YouTube or SoundCloud.

type SkipTracker

type SkipTracker interface {
	AddTrackSkip(*gumble.User) error
	AddPlaylistSkip(*gumble.User) error
	RemoveTrackSkip(*gumble.User) error
	RemovePlaylistSkip(*gumble.User) error
	NumTrackSkips() int
	NumPlaylistSkips() int
	ResetTrackSkips()
	ResetPlaylistSkips()
}

SkipTracker is the interface which should be interacted with for skip operations. Using the SkipTracker interface ensures thread safety.

type Track

type Track interface {
	GetID() string
	GetURL() string
	GetTitle() string
	GetAuthor() string
	GetAuthorURL() string
	GetSubmitter() string
	GetService() string
	GetFilename() string
	GetThumbnailURL() string
	GetThumbnailBase64() string
	GetDuration() time.Duration
	GetPlaybackOffset() time.Duration
	GetPlaylist() Playlist
}

Track is an interface of methods that must be implemented by tracks.

Jump to

Keyboard shortcuts

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