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)