db.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package entity
  2. type MongoDB struct {
  3. Main *MongoDBStruct `json:"main"`
  4. Bidding *MongoDBStruct `json:"bidding"`
  5. }
  6. //
  7. type MongoDBStruct struct {
  8. Address string `json:"address"`
  9. Size int `json:"size"`
  10. DbName string `json:"dbName"`
  11. UserName string `json:"userName,optional"`
  12. Password string `json:"password,optional"`
  13. Collection string `json:"collection,optional"`
  14. CollectionBack string `json:"collectionBack,optional"`
  15. MaxOpenConns int `json:"maxOpenConns,optional"`
  16. MaxIdleConns int `json:"maxIdleConns,optional"`
  17. }
  18. //
  19. type Mysql struct {
  20. Main *MysqlStruct `json:"main"`
  21. }
  22. //mysql
  23. type MysqlStruct struct {
  24. DbName string `json:"dbName"`
  25. Address string `json:"address"`
  26. UserName string `json:"userName"`
  27. Password string `json:"password"`
  28. MaxOpenConns int `json:"maxOpenConns"`
  29. MaxIdleConns int `json:"maxIdleConns"`
  30. }
  31. //redis
  32. type RedisDBStuct struct {
  33. Addr []string `json:"addr"`
  34. }
  35. //es
  36. type EsStruct struct {
  37. Addr string `json:"addr"`
  38. Size int `json:"size"`
  39. }