瀏覽代碼

上传文件至 'resourceChannel'

新增conf.go
go_dev 1 年之前
父節點
當前提交
b8b410a058
共有 1 個文件被更改,包括 20 次插入0 次删除
  1. 20 0
      resourceChannel/conf.go

+ 20 - 0
resourceChannel/conf.go

@@ -0,0 +1,20 @@
+package resourceChannel
+
+import (
+	"sync"
+)
+
+type Conf struct {
+	SystemName string `yaml:"system_name"` // 系统名称
+	RedisHost  string `yaml:"redis_host"`  // redis主机
+}
+
+var once sync.Once
+var coo *Conf
+
+func GetMyConf(RedisHost string) *Conf {
+	once.Do(func() {
+		coo = &Conf{RedisHost: RedisHost}
+	})
+	return coo
+}