database.go 1.9 KB

123456789101112131415161718192021222324252627282930
  1. package config
  2. type Database struct {
  3. Mysql struct {
  4. Driver string `mapstructure:"driver" json:"driver" yaml:"driver"`
  5. Host string `mapstructure:"host" json:"host" yaml:"host"`
  6. Port int `mapstructure:"port" json:"port" yaml:"port"`
  7. Database string `mapstructure:"database" json:"database" yaml:"database"`
  8. UserName string `mapstructure:"username" json:"username" yaml:"username"`
  9. Password string `mapstructure:"password" json:"password" yaml:"password"`
  10. Charset string `mapstructure:"charset" json:"charset" yaml:"charset"`
  11. ParseTime bool `mapstructure:"parseTime" json:"parseTime" yaml:"parseTime"`
  12. Loc string `mapstructure:"loc" json:"loc" yaml:"loc"`
  13. MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"`
  14. MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"`
  15. LogMode string `mapstructure:"log_mode" json:"log_mode" yaml:"log_mode"`
  16. EnableFileLogWriter bool `mapstructure:"enable_file_log_writer" json:"enable_file_log_writer" yaml:"enable_file_log_writer"`
  17. LogFilename string `mapstructure:"log_filename" json:"log_filename" yaml:"log_filename"`
  18. }
  19. StarRocks struct {
  20. Host string `mapstructure:"host" json:"host" yaml:"host"`
  21. Port int `mapstructure:"port" json:"port" yaml:"port"`
  22. Database string `mapstructure:"database" json:"database" yaml:"database"`
  23. UserName string `mapstructure:"username" json:"username" yaml:"username"`
  24. Password string `mapstructure:"password" json:"password" yaml:"password"`
  25. Loc string `mapstructure:"loc" json:"loc" yaml:"loc"`
  26. MaxIdleConns int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"`
  27. MaxOpenConns int `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"`
  28. }
  29. }