Add playlist-generation

This commit is contained in:
2021-09-14 22:51:36 +02:00
parent 6e15d9835c
commit 584ffffe83
10 changed files with 192 additions and 23 deletions

View File

@@ -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
}