dyndns/webapi/config.go

24 lines
314 B
Go
Raw Normal View History

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")
}