db.go 1.2 KB

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