Torben Nehmer
9f1b9f1690
- renamed clientoinfo to updaterequest - added userconfig skeleton - added hashed password skeleton
28 lines
586 B
Go
28 lines
586 B
Go
package service
|
|
|
|
import "github.com/spf13/viper"
|
|
|
|
type config struct {
|
|
DNSServer string
|
|
DNSDefaultTTL uint32
|
|
UsersConfigDir string
|
|
}
|
|
|
|
var C config
|
|
|
|
func init() {
|
|
SetConfigDefaults()
|
|
}
|
|
|
|
func SetConfigDefaults() {
|
|
viper.SetDefault("Service.DNS.Server", "10.10.11.254:53")
|
|
viper.SetDefault("Service.DNS.DefaultTTL", 60)
|
|
viper.SetDefault("Service.Users.ConfigDir", "users/")
|
|
}
|
|
|
|
func LoadConfig() {
|
|
C.DNSServer = viper.GetString("Service.DNS.Server")
|
|
C.DNSDefaultTTL = viper.GetUint32("Service.DNS.DefaultTTL")
|
|
C.UsersConfigDir = viper.GetString("Service.Users.ConfigDir")
|
|
}
|