1
0

database.go 429 B

123456789101112131415161718192021222324
  1. package config
  2. type Database struct {
  3. Driver string
  4. Source string
  5. Host string
  6. ConnMaxIdleTime int
  7. ConnMaxLifeTime int
  8. MaxIdleConns int
  9. MaxOpenConns int
  10. Registers []DBResolverConfig
  11. }
  12. type DBResolverConfig struct {
  13. Sources []string
  14. Replicas []string
  15. Policy string
  16. Tables []string
  17. }
  18. var (
  19. DatabaseConfig = new(Database)
  20. DatabasesConfig = make(map[string]*Database)
  21. )