Add bolt provider, rewrite hosts, start of api, start of update via nsupdate

This commit is contained in:
Tyler
2021-04-14 23:42:24 -04:00
parent 3383c5e4f9
commit f38586dcb0
18 changed files with 684 additions and 539 deletions

View File

@ -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"`