config.go 1.0 KB

1234567891011121314151617181920212223242526272829
  1. package conf
  2. import (
  3. beego "github.com/beego/beego/v2/server/web"
  4. )
  5. func init() {
  6. beego.LoadAppConfig("ini", "a/conf/app.conf")
  7. }
  8. var HTTPPort, _ = beego.AppConfig.Int("HTTPPort")
  9. var AppName, _ = beego.AppConfig.String("appname")
  10. // Redis
  11. var Redis_address, _ = beego.AppConfig.String("Redis_address")
  12. var Redis_password, _ = beego.AppConfig.String("Redis_password")
  13. var Redis_dbNum, _ = beego.AppConfig.String("Redis_dbNum")
  14. // Mysql
  15. var MysqlServer_UrlPort, _ = beego.AppConfig.String("MysqlServer_UrlPort")
  16. var MysqlServer_Database, _ = beego.AppConfig.String("MysqlServer_Database")
  17. var MysqlServer_Username, _ = beego.AppConfig.String("MysqlServer_Username")
  18. var MysqlServer_Password, _ = beego.AppConfig.String("MysqlServer_Password")
  19. var MysqlServer_MaxIdleConnections, _ = beego.AppConfig.Int("MysqlServer_MaxIdleConnections")
  20. var MysqlServer_MaxOpenConnections, _ = beego.AppConfig.Int("MysqlServer_MaxOpenConnections")
  21. var EWarningAdmin = []int{1} // 管理
  22. // Nats
  23. var NatsServer_Url, _ = beego.AppConfig.String("NatsServer_Url")