config.go 337 B

123456789101112131415161718192021
  1. package conf
  2. import (
  3. "github.com/Unknwon/goconfig"
  4. )
  5. var Config *goconfig.ConfigFile
  6. var NatsServer_Url string
  7. func init() {
  8. var err error
  9. Config, err = goconfig.LoadConfigFile("conf/conf.ini")
  10. if err != nil {
  11. panic(any("conf/conf.ini 没找到!"))
  12. }
  13. // Nats
  14. NatsServer_Url, _ = Config.GetValue("", "NatsServer_Url")
  15. }