dyndns/webapi/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

24 lines
314 B
Go

package webapi
import (
"github.com/spf13/viper"
)
type config struct {
ListenAddress string
}
var C config
func init() {
SetConfigDefaults()
}
func SetConfigDefaults() {
viper.SetDefault("WebAPI.ListenAddress", ":8080")
}
func LoadConfig() {
C.ListenAddress = viper.GetString("WebAPI.ListenAddress")
}