From 7f4c193b0f75c58be22f66880701f341da304f39 Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 5 Mar 2025 17:47:13 +0100 Subject: [PATCH] recreate conf erased by gitignore --- conf/app.conf | 10 ++++++++++ conf/config.go | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 conf/app.conf create mode 100644 conf/config.go 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