db.go 1.4 KB

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