]>
code.octet-stream.net Git - broadcaster/blob - server/config.go
4a4866c3c701ceabbd09e6bfa7370df9662a2b08
7 "github.com/BurntSushi/toml"
10 type ServerConfig
struct {
17 func NewServerConfig() ServerConfig
{
19 BindAddress
: "0.0.0.0",
26 func (c
*ServerConfig
) LoadFromFile(path
string) {
27 _
, err
:= toml
.DecodeFile(path
, &c
)
29 log
.Fatal("could not read config file for reading at path:", path
, err
)
37 func (c
*ServerConfig
) Validate() error
{
39 return errors
.New("Configuration must provide SqliteDB")
41 if c
.AudioFilesPath
== "" {
42 return errors
.New("Configuration must provide AudioFilesPath")