conf.go 325 B

1234567891011121314151617181920
  1. package resourceChannel
  2. import (
  3. "sync"
  4. )
  5. type Conf struct {
  6. SystemName string `yaml:"system_name"` // 系统名称
  7. RedisHost string `yaml:"redis_host"` // redis主机
  8. }
  9. var once sync.Once
  10. var coo *Conf
  11. func GetMyConf(RedisHost string) *Conf {
  12. once.Do(func() {
  13. coo = &Conf{RedisHost: RedisHost}
  14. })
  15. return coo
  16. }