新增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