db.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * @description: mysql配置信息
  3. * @Author: CP
  4. * @Date: 2020-08-20 22:25:13
  5. * @FilePath: \construction_management\conf\db.go
  6. */
  7. package conf
  8. const DriverName = "mysql"
  9. type DbConfig struct {
  10. Host string `mapstructure:"host" json:"host"`
  11. Port int `mapstructure:"port" json:"port"`
  12. User string `mapstructure:"user" json:"user"`
  13. Pwd string `mapstructure:"pwd" json:"pwd"`
  14. Datebase string `mapstructure:"datebase" json:"datebase"`
  15. IsRunning bool
  16. }
  17. var MysqlConfig DbConfig
  18. var DbMasterList = []DbConfig{
  19. // 单体数据库222
  20. {
  21. Host: "192.168.1.170",
  22. Port: 30000,
  23. User: "root",
  24. Pwd: "root",
  25. Datebase: "construction",
  26. IsRunning: true,
  27. },
  28. // 集群数据库
  29. {
  30. Host: "192.168.1.26",
  31. Port: 8066,
  32. User: "root",
  33. Pwd: "123456",
  34. Datebase: "construction",
  35. IsRunning: true,
  36. },
  37. // QA
  38. {
  39. Host: "192.168.1.76",
  40. Port: 3306,
  41. User: "zh_dev",
  42. Pwd: "zongheng2019",
  43. Datebase: "construction",
  44. IsRunning: true,
  45. },
  46. {
  47. Host: "8.135.240.149",
  48. Port: 3306,
  49. User: "zongheng",
  50. Pwd: "@)!(smartcost#*%)",
  51. Datebase: "construction",
  52. IsRunning: true,
  53. },
  54. }
  55. var DbMaster = DbMasterList[3]