فهرست منبع

上传文件至 '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
+}