streamer

package
v0.0.0-...-fd00b2c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, cfg config.Config) error

Execute starts a streamer instance and its RPC API server

func NewHTTPServer

func NewHTTPServer(cfg config.Config, storage radio.StorageService,
	queue radio.QueueService, announce radio.AnnounceService,
	streamer *Streamer) (*grpc.Server, error)

NewHTTPServer returns a http server with RPC API handler and debug handlers

Types

type QueueService

type QueueService struct {
	config.Config

	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

func (qs *QueueService) AddRequest(ctx context.Context, song radio.Song, identifier string) error

AddRequest implements radio.QueueService

func (*QueueService) Entries

func (qs *QueueService) Entries(ctx context.Context) ([]radio.QueueEntry, error)

Entries returns all entries in the queue

func (*QueueService) Remove

func (qs *QueueService) Remove(ctx context.Context, id radio.QueueID) (bool, error)

Remove removes the song given from the queue

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 Streamer

type Streamer struct {
	config.Config

	// Format of the PCM audio data
	AudioFormat audio.AudioFormat
	// contains filtered or unexported fields
}

Streamer represents a single icecast stream

func NewStreamer

func NewStreamer(ctx context.Context, cfg config.Config, queue radio.QueueService) (*Streamer, error)

NewStreamer returns a new streamer using the state given

func (*Streamer) ForceStop

func (s *Streamer) ForceStop(ctx context.Context) error

ForceStop stops the streamer and tries to stop as soon as possible

func (*Streamer) Start

func (s *Streamer) Start(ctx context.Context)

Start starts the streamer with the context given, Start is a noop if already started

func (*Streamer) Stop

func (s *Streamer) Stop(ctx context.Context) error

Stop stops the streamer, but waits until the current track is done

func (*Streamer) Wait

func (s *Streamer) Wait() error

Wait waits for the streamer to stop running; either by an error occuring or by someone else calling Stop or ForceStop.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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