local-ip.sh/utils/config.go

30 lines
472 B
Go
Raw Normal View History

2024-07-26 10:16:23 +00:00
package utils
import (
"github.com/spf13/viper"
)
type config struct {
DnsPort uint `mapstructure:"dns-port"`
HttpPort uint `mapstructure:"http-port"`
HttpsPort uint `mapstructure:"https-port"`
Domain string
Email string
NameServers []string
CADirURL string
AccountFilePath string
KeyFilePath string
}
var conf = &config{}
func InitConfig() *config {
viper.Unmarshal(conf)
return conf
}
func GetConfig() *config {
return conf
}