Add playlist-generation
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
var ErrNotFound = errors.New("no config file found")
|
||||
|
||||
type Config struct {
|
||||
Hostname string `toml:"Hostname"`
|
||||
RTMPListenAddr string `toml:"RTMPListenAddr"`
|
||||
HTTPServerEnable bool `toml:"HTTPServerEnable"`
|
||||
HTTPListenAddr string `toml:"HTTPListenAddr"`
|
||||
@@ -36,6 +37,7 @@ func FromReader(r io.Reader) (*Config, error) {
|
||||
c.HTTPServerEnable = false
|
||||
c.HTTPListenAddr = ":8077"
|
||||
c.LogLevel = "INFO"
|
||||
c.Hostname = "localhost"
|
||||
|
||||
decoder := toml.NewDecoder(r)
|
||||
if err := decoder.Decode(&c); err != nil {
|
||||
@@ -56,6 +58,9 @@ func (c *Config) Verify() error {
|
||||
}
|
||||
|
||||
func (c *Config) UpdateFromEnv() error {
|
||||
if hostname, found := os.LookupEnv("DOGTAMER_HOSTNAME"); found {
|
||||
c.Hostname = hostname
|
||||
}
|
||||
if loglevel, found := os.LookupEnv("DOGTAMER_LOGLEVEL"); found {
|
||||
c.LogLevel = loglevel
|
||||
}
|
||||
|
Reference in New Issue
Block a user