Documentation
¶
Index ¶
- Variables
- func RandomID(src rand.Source) string
- func RandomTrackID(src rand.Source) string
- func SaveRotator(r Rotator) []byte
- type DB
- type HistoryDB
- type QueueDB
- type QueueID
- type QueueOptions
- type QueueTrack
- type QueueType
- type Room
- type RoomDB
- type RoomID
- type Rotator
- type RotatorType
- type TrackEntry
- type User
- type UserDB
- type UserID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOperationNotImplemented = errors.New("radiotation: operation not implemented") ErrUserNotFound = errors.New("radiotation: user not found") ErrRoomNotFound = errors.New("radiotation: room not found") ErrQueueNotFound = errors.New("radiotation: queue not found") ErrNoTracksInQueue = errors.New("radiotation: no tracks in queue") )
Functions ¶
func RandomTrackID ¶
func SaveRotator ¶
Types ¶
type HistoryDB ¶
type HistoryDB interface {
History(RoomID) ([]*TrackEntry, error)
AddToHistory(RoomID, *TrackEntry) (int, error)
MarkVetoed(RoomID, UserID) error
}
type QueueOptions ¶
type QueueOptions struct {
Type QueueType
}
type QueueTrack ¶
type Room ¶
type Room struct {
ID RoomID `json:"id"`
DisplayName string `json:"displayName"`
RotatorType RotatorType `json:"-"`
}
type Rotator ¶
type Rotator interface {
// NextIndex returns the next index in the rotation.
NextIndex() int
// Add adds a new index into the rotation. Depending on the implementation,
// this may or may not be at the end. It's invalid to call NextIndex() before
// Add() has been called at least once.
Add()
}
A Rotator says what the next index should be from a list of size n. They can assume that n will never decrease, but it can increase between any two invocations of start.
func LoadRotator ¶
func NewRotator ¶
func NewRotator(r RotatorType) Rotator
type RotatorType ¶
type RotatorType int
RotatorType is an enum for the type of rotation for the room.
const ( RoundRobin RotatorType = iota Shuffle Random )
func (RotatorType) String ¶
func (r RotatorType) String() string
type TrackEntry ¶
Click to show internal directories.
Click to hide internal directories.