dyndns/service/config.go
Torben Nehmer 7dd11a0879 First basic version
- NFT and DNS Update skeletons
- Integrated viper configuration management
- Integrated cobra CLI management
- Basic webservice skeleton
2021-08-20 21:10:59 +02:00

25 lines
434 B
Go

package service
import "github.com/spf13/viper"
type config struct {
DNSServer string
DefaultTTL uint32
}
var C config
func init() {
SetConfigDefaults()
}
func SetConfigDefaults() {
viper.SetDefault("Service.DNS.Server", "10.10.11.254:53")
viper.SetDefault("Service.DNS.DefaultTTL", 60)
}
func LoadConfig() {
C.DNSServer = viper.GetString("Service.DNS.Server")
C.DefaultTTL = viper.GetUint32("Service.DNS.DefaultTTL")
}