icecast

package
v0.0.0-...-dd72184 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

IcecastController manages a local Icecast daemon.

Managing the local Icecast instance is a less simple task than it might look, as the details tend to be distribution-specific. We'd like to avoid implementing yet another service manager within radiod, so we are just going to assume that the Icecast daemon is managed using the local distribution-specific tools, and is running independently of radiod. Furthermore, we're going to make the following assumptions:

- We have permissions to modify the Icecast config file;

- We have installed our status XSLT page;

- We can reload the Icecast service (send the icecast2 process a SIGHUP). Ideally we'd like to use the distribution-specific method, but with systemd we need to use "sudo". The code tries to autodetect a supported mechanism.

The above is usually accomplished by running radiod as the same user that is running the Icecast daemon.

func NewController

func NewController(ctx context.Context, port int, configPath, adminPwPath string) (*Controller, error)

NewController returns a new Controller that manages a (independently started) local Icecast daemon. The context is used to cancel background processing.

func (*Controller) GetStatus

func (c *Controller) GetStatus() ([]*pb.IcecastMount, bool)

func (*Controller) Update

func (c *Controller) Update(ctx context.Context, mounts []*pb.Mount, isMaster bool, masterAddr string) error

Update reloads the Icecast daemon with a new configuration.

Jump to

Keyboard shortcuts

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