Documentation
¶
Index ¶
- Variables
- func Execute(ctx context.Context, cfg config.Config) error
- func NewGRPCServer(ctx context.Context, cfg config.Config, storage radio.StorageService, ...) (*grpc.Server, error)
- func NewTracks(ctx context.Context, fds *fdstore.Store, st []StreamTrack) *trackstore
- type QueueService
- func (qs *QueueService) AddRequest(ctx context.Context, song radio.Song, identifier string) error
- func (qs *QueueService) Entries(ctx context.Context) (radio.Queue, error)
- func (qs *QueueService) Remove(ctx context.Context, id radio.QueueID) (bool, error)
- func (qs *QueueService) ReserveNext(ctx context.Context) (*radio.QueueEntry, error)
- func (qs *QueueService) ResetReserved(ctx context.Context) error
- type StreamTrack
- type Streamer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDecoder = errors.New("decoder error") ErrForce = errors.New("force stop") )
Functions ¶
func NewGRPCServer ¶
func NewGRPCServer(ctx context.Context, cfg config.Config, storage radio.StorageService, queue radio.QueueService, announce radio.AnnounceService, streamer *Streamer) (*grpc.Server, error)
NewGRPCServer returns a http server with RPC API handler and debug handlers
Types ¶
type QueueService ¶
type QueueService struct { Storage radio.StorageService // contains filtered or unexported fields }
QueueService implements radio.QueueService that uses a random population algorithm
func NewQueueService ¶
func NewQueueService(ctx context.Context, cfg config.Config, storage radio.StorageService) (*QueueService, error)
NewQueueService returns you a new QueueService with the configuration given
func (*QueueService) AddRequest ¶
AddRequest implements radio.QueueService
func (*QueueService) ReserveNext ¶
func (qs *QueueService) ReserveNext(ctx context.Context) (*radio.QueueEntry, error)
ReserveNext implements radio.QueueService
func (*QueueService) ResetReserved ¶
func (qs *QueueService) ResetReserved(ctx context.Context) error
ResetReserved implements radio.QueueService
type StreamTrack ¶
type StreamTrack struct { radio.QueueEntry Audio audio.Reader }
func (*StreamTrack) TotalLength ¶
func (st *StreamTrack) TotalLength() time.Duration
type Streamer ¶
type Streamer struct { // configuration fields, these shouldn't change after creation config.Config // AudioFormat is the format of the audio we're streaming AudioFormat audio.AudioFormat // StreamUser is the user we're streaming as StreamUser radio.User // contains filtered or unexported fields }
func NewStreamer ¶
func NewStreamer(ctx context.Context, cfg config.Config, fdstorage *fdstore.Store, qs radio.QueueService, us radio.UserStorage, ) (*Streamer, error)
NewStreamer returns a new streamer using the state given
Click to show internal directories.
Click to hide internal directories.