diff --git a/conf/app.conf b/conf/app.conf new file mode 100644 index 0000000..10e6e5f --- /dev/null +++ b/conf/app.conf @@ -0,0 +1,10 @@ +appname = oc-datacenter +httpport = 8080 +runmode = dev +autorender = false +copyrequestbody = true +EnableDocs = true +sqlconn = + +MONGO_URL = "mongodb://127.0.0.1:27017/beego-demo" +MONGO_DATABASE = "DC_myDC-demo_06042021" \ No newline at end of file diff --git a/conf/config.go b/conf/config.go new file mode 100644 index 0000000..5e48d0b --- /dev/null +++ b/conf/config.go @@ -0,0 +1,22 @@ +package conf + +import "sync" + +type Config struct { + Mode string + KubeHost string + KubePort string + KubeCA string + KubeCert string + KubeData string +} + +var instance *Config +var once sync.Once + +func GetConfig() *Config { + once.Do(func() { + instance = &Config{} + }) + return instance +} \ No newline at end of file