db.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. BiService *MysqlStruct `json:"biService"`
  22. }
  23. // mysql
  24. type MysqlStruct struct {
  25. DbName string `json:"dbName"`
  26. Address string `json:"address"`
  27. UserName string `json:"userName"`
  28. Password string `json:"password"`
  29. MaxOpenConns int `json:"maxOpenConns"`
  30. MaxIdleConns int `json:"maxIdleConns"`
  31. }
  32. // redis
  33. type RedisStuct struct {
  34. Addr []string `json:"addr"`
  35. }
  36. // es
  37. type EsStruct struct {
  38. Addr string `json:"addr"`
  39. Size int `json:"size"`
  40. Version string `json:"version"`
  41. UserName string `json:"userName"`
  42. Password string `json:"password"`
  43. Type string `json:"type,optional"`
  44. Index string `json:"index,optional"`
  45. }