2018-01-13 13:41:49 +00:00
|
|
|
package respond
|
|
|
|
|
|
|
|
import "github.com/FreifunkBremen/yanic/lib/duration"
|
|
|
|
|
|
|
|
type Config struct {
|
2018-01-17 19:20:35 +00:00
|
|
|
Enable bool `toml:"enable"`
|
|
|
|
Synchronize duration.Duration `toml:"synchronize"`
|
|
|
|
Interfaces []string `toml:"interfaces"`
|
|
|
|
Sites map[string]SiteConfig `toml:"sites"`
|
|
|
|
Port int `toml:"port"`
|
|
|
|
CollectInterval duration.Duration `toml:"collect_interval"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Config) SitesDomains() (result map[string][]string) {
|
|
|
|
result = make(map[string][]string)
|
|
|
|
for site, siteConfig := range c.Sites {
|
|
|
|
result[site] = siteConfig.Domains
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type SiteConfig struct {
|
|
|
|
Domains []string `toml:"domains"`
|
2018-01-13 13:41:49 +00:00
|
|
|
}
|