db.go 1001 B

123456789101112131415161718192021222324252627282930313233
  1. package entity
  2. type RedisStuct struct {
  3. Addr []string `json:"addr"`
  4. }
  5. type Mysql struct {
  6. Main *MysqlStruct `json:"main,omitempty"`
  7. BaseService *MysqlStruct `json:"baseService,omitempty"`
  8. }
  9. type Mongo struct {
  10. Main *MongoStruct `json:"main,optional"`
  11. }
  12. type MongoStruct struct {
  13. Address string `json:"address"`
  14. Size int `json:"size"`
  15. DbName string `json:"dbName"`
  16. UserName string `json:"userName,optional"`
  17. Password string `json:"password,optional"`
  18. Collection string `json:"collection,optional"`
  19. CollectionBack string `json:"collectionBack,optional"`
  20. MaxOpenConns int `json:"maxOpenConns,optional"`
  21. MaxIdleConns int `json:"maxIdleConns,optional"`
  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. }