config.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // Mqtt
  22. var MqttServer_id, _ = beego.AppConfig.String("MqttServer_id")
  23. var MqttServer_Url, _ = beego.AppConfig.String("MqttServer_Url")
  24. var MqttServer_Username, _ = beego.AppConfig.String("MqttServer_Username")
  25. var MqttServer_Password, _ = beego.AppConfig.String("MqttServer_Password")
  26. var MqttServer_ClientID, _ = beego.AppConfig.String("MqttServer_ClientID")
  27. // Nats
  28. var NatsServer_Url, _ = beego.AppConfig.String("NatsServer_Url")
  29. var EWarningAdmin = []int{1} // 管理
  30. var Page_size = 10