types.go 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. package config
  2. import "time"
  3. // Config is config struct
  4. type Config struct {
  5. AppName string `yaml:"appName" json:"appName"`
  6. GinMode string `yaml:"ginMode" json:"ginMode"`
  7. LogMode string `yaml:"logMode" json:"logMode"`
  8. LogPath string `yaml:"logPath" json:"logPath"`
  9. Port int `yaml:"port" json:"port"`
  10. LogMySQL MySQL `yaml:"logMysql" json:"logMysql"`
  11. //JWT JWT `yaml:"JWT" json:"JWT"`
  12. Batch BatchConfig `yaml:"batch" json:"batch"`
  13. }
  14. type BatchConfig struct {
  15. BatchSize int `yaml:"batchSize" json:"batchSize"`
  16. FlushTimeout time.Duration `yaml:"flushTimeout" json:"flushTimeout"`
  17. ChannelSize int `yaml:"channelSize" json:"channelSize"`
  18. }
  19. // MySQLBase is base config of mysql
  20. type MySQL struct {
  21. Addr string `yaml:"addr"`
  22. Username string `yaml:"username"`
  23. Password string `yaml:"password"`
  24. DbName string `yaml:"db_name"`
  25. MaxIdleConnections int `yaml:"max_idle_connections"`
  26. MaxOpenConnections int `yaml:"max_open_connections"`
  27. }