Add bolt provider, rewrite hosts, start of api, start of update via nsupdate
This commit is contained in:
@ -1,18 +1,9 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"meow.tf/joker/godns/log"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var LogLevelMap = map[string]int{
|
||||
"DEBUG": log.LevelDebug,
|
||||
"INFO": log.LevelInfo,
|
||||
"NOTICE": log.LevelNotice,
|
||||
"WARN": log.LevelWarn,
|
||||
"ERROR": log.LevelError,
|
||||
}
|
||||
|
||||
type HostsSettings struct {
|
||||
HostsFile string `toml:"host-file" env:"HOSTS_FILE"`
|
||||
RedisEnable bool `toml:"redis-enable" env:"REDIS_HOSTS_ENABLE"`
|
||||
@ -67,14 +58,6 @@ type LogSettings struct {
|
||||
Level string `toml:"level" env:"LOG_LEVEL"`
|
||||
}
|
||||
|
||||
func LogLevelFor(level string) int {
|
||||
l, ok := LogLevelMap[level]
|
||||
if !ok {
|
||||
panic("Config error: invalid log level: " + level)
|
||||
}
|
||||
return l
|
||||
}
|
||||
|
||||
type CacheSettings struct {
|
||||
Backend string `toml:"backend" env:"CACHE_BACKEND"`
|
||||
Expire int `toml:"expire" env:"CACHE_EXPIRE"`
|
||||
|
Reference in New Issue
Block a user