db.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package entity
  2. type Mongo struct {
  3. Main *MongoStruct `json:"main,optional"`
  4. MgoLog *MongoStruct `json:"mgoLog,optional"`
  5. Ent *MongoStruct `json:"ent,optional"`
  6. Bidding *MongoStruct `json:"bidding,optional"`
  7. }
  8. //
  9. type MongoStruct struct {
  10. Address string `json:"address"`
  11. Size int `json:"size"`
  12. DbName string `json:"dbName"`
  13. UserName string `json:"userName,optional"`
  14. Password string `json:"password,optional"`
  15. Collection string `json:"collection,optional"`
  16. CollectionBack string `json:"collectionBack,optional"`
  17. MaxOpenConns int `json:"maxOpenConns,optional"`
  18. MaxIdleConns int `json:"maxIdleConns,optional"`
  19. }
  20. type Mysql struct {
  21. Main *MysqlStruct `json:"main,optional"`
  22. BaseService *MysqlStruct `json:"baseService,omitempty"`
  23. Push *MysqlStruct `json:"push,optional"`
  24. MemberPush *MysqlStruct `json:"memberPush"`
  25. EntnichePush *MysqlStruct `json:"entnichePush"`
  26. }
  27. //mysql
  28. type MysqlStruct struct {
  29. DbName string `json:"dbName,optional"`
  30. Address string `json:"address,optional"`
  31. UserName string `json:"userName,optional"`
  32. Password string `json:"password,optional"`
  33. MaxOpenConns int `json:"maxOpenConns,optional"`
  34. MaxIdleConns int `json:"maxIdleConns,optional"`
  35. }
  36. //redis
  37. type RedisStuct struct {
  38. Addr []string `json:"addr"`
  39. }
  40. //es
  41. type EsStruct struct {
  42. Addr string `json:"addr"`
  43. Size int `json:"size"`
  44. Version string `json:"version"`
  45. UserName string `json:"userName"`
  46. Password string `json:"password"`
  47. }
  48. const (
  49. ListModeCollection = "list_mode" // 搜索/订阅 列表模式 集合
  50. )