ServerConfig -> StaticConfig to match the config file

This commit is contained in:
Frank Denis 2018-01-31 08:43:49 +01:00
parent cdb8faba75
commit d42ab83184
1 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,7 @@ type Config struct {
BlockName BlockNameConfig `toml:"blacklist"`
BlockIP BlockIPConfig `toml:"ip_blacklist"`
ForwardFile string `toml:"forwarding_rules"`
ServersConfig map[string]ServerConfig `toml:"static"`
ServersConfig map[string]StaticConfig `toml:"static"`
SourcesConfig map[string]SourceConfig `toml:"sources"`
SourceRequireDNSSEC bool `toml:"require_dnssec"`
SourceRequireNoLog bool `toml:"require_nolog"`
@ -68,7 +68,7 @@ func newConfig() Config {
}
}
type ServerConfig struct {
type StaticConfig struct {
Stamp string
}
@ -247,14 +247,14 @@ func (config *Config) loadSources(proxy *Proxy) error {
}
}
for _, serverName := range config.ServerNames {
serverConfig, ok := config.ServersConfig[serverName]
staticConfig, ok := config.ServersConfig[serverName]
if !ok {
continue
}
if len(serverConfig.Stamp) == 0 {
if len(staticConfig.Stamp) == 0 {
dlog.Fatalf("Missing stamp for the static [%s] definition", serverName)
}
stamp, err := NewServerStampFromString(serverConfig.Stamp)
stamp, err := NewServerStampFromString(staticConfig.Stamp)
if err != nil {
return err
}