db.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package entity
  2. type Mongo struct {
  3. Main *MongoStruct `json:"main,optional"`
  4. MgoLog *MongoStruct `json:"mgoLog,optional"`
  5. Bidding *MongoStruct `json:"bidding,optional"`
  6. }
  7. type MongoStruct 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. type Mysql struct {
  19. Main *MysqlStruct `json:"main"`
  20. Base *MysqlStruct `json:"base"`
  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 RedisStuct struct {
  33. Addr []string `json:"addr"`
  34. }
  35. // es
  36. type EsStruct struct {
  37. Addr string `json:"addr"`
  38. Size int `json:"size"`
  39. Version string `json:"version"`
  40. UserName string `json:"userName"`
  41. Password string `json:"password"`
  42. Type string `json:"type,optional"`
  43. Index string `json:"index,optional"`
  44. }