Documentation ¶
Index ¶
- type CryptoRandSource
- type DB
- func (s *DB) AddRoom(rm *db.Room) (db.RoomID, error)
- func (s *DB) AddToHistory(rid db.RoomID, te *db.TrackEntry) (int, error)
- func (s *DB) AddTrack(qID db.QueueID, track *radio.Track, afterQTID string) error
- func (s *DB) AddUser(user *db.User) error
- func (s *DB) AddUserToRoom(rid db.RoomID, uid db.UserID) error
- func (s *DB) Close() error
- func (s *DB) History(rid db.RoomID) ([]*db.TrackEntry, error)
- func (s *DB) MarkVetoed(rid db.RoomID, uid db.UserID) error
- func (s *DB) NextTrack(rID db.RoomID) (*db.User, *radio.Track, error)
- func (s *DB) RemoveTrack(qID db.QueueID, qtID string) error
- func (s *DB) Room(rid db.RoomID) (*db.Room, error)
- func (s *DB) SearchRooms(q string) ([]*db.Room, error)
- func (s *DB) Tracks(qID db.QueueID, qo *db.QueueOptions) ([]*db.QueueTrack, error)
- func (s *DB) User(id db.UserID) (*db.User, error)
- func (s *DB) Users(rid db.RoomID) ([]*db.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoRandSource ¶
type CryptoRandSource struct{}
func (CryptoRandSource) Int63 ¶
func (CryptoRandSource) Int63() int64
func (CryptoRandSource) Seed ¶
func (CryptoRandSource) Seed(int64)
type DB ¶
DB implements the Radiotation database API, backed by a SQLite database. NOTE: Since the database doesn't support concurrent writers, we don't actually hold the *sql.DB in this struct, we force all callers to get a handle via channels.
func (*DB) AddToHistory ¶
func (*DB) AddTrack ¶
AddTrack adds a track after the given qtID. If a blank ID is given, the song is added first. The song can't be added before a song that's already played.
func (*DB) RemoveTrack ¶
RemoveTrack remove a given track from a queue. To do it, we find the QueueTrack in question, get it's previous/next tracks, and update their pointers to each other.
func (*DB) Tracks ¶
func (s *DB) Tracks(qID db.QueueID, qo *db.QueueOptions) ([]*db.QueueTrack, error)
Click to show internal directories.
Click to hide internal directories.