package settings

type AppConfig struct {
	*BaseConfig      `mapstructure:"base"`
	*LogConfig       `mapstructure:"log"`
	*SnowflakeConfig `mapstructure:"snowflake"`
	*RateLimitConfig `mapstructure:"rate"`
	*JwtConfig       `mapstructure:"jwt"`
}

type BaseConfig struct {
	Port    int    `mapstructure:"port"`
	Name    string `mapstructure:"name"`
	Mode    string `mapstructure:"mode"`
	Version string `mapstructure:"version"`
}

type LogConfig struct {
	Level      string `mapstructure:"level"`
	Filename   string `mapstructure:"filename"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	MaxBackUps int    `mapstructure:"max_backups"`
}

type SnowflakeConfig struct {
	StartTime string `mapstructure:"start_time"`
	MachineId int64  `mapstructure:"machine_id"`
}

type RateLimitConfig struct {
	FillInterval int64 `mapstructure:"fill_interval"`
	Capacity     int64 `mapstructure:"capacity"`
	MaxWait      int64 `mapstructure:"max_wait"`
}

type JwtConfig struct {
	Salt   string `mapstructure:"salt"`
	Expire int64  `mapstructure:"expire"`
}
