52 lines
1.4 KiB
Go
52 lines
1.4 KiB
Go
package settings
|
|
|
|
type AppConfig struct {
|
|
*BaseConfig `mapstructure:"base"`
|
|
*LogConfig `mapstructure:"log"`
|
|
*SnowflakeConfig `mapstructure:"snowflake"`
|
|
*RateLimitConfig `mapstructure:"rate"`
|
|
*JwtConfig `mapstructure:"jwt"`
|
|
*SqlConfig `mapstructure:"database"`
|
|
}
|
|
|
|
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 SqlConfig struct {
|
|
Port int `mapstructure:"port"`
|
|
MaxConns int `mapstructure:"max_conns"`
|
|
Host string `mapstructure:"host"`
|
|
Username string `mapstructure:"user"`
|
|
Password string `mapstructure:"password"`
|
|
Database string `mapstructure:"db_name"`
|
|
Type string `mapstructure:"type"`
|
|
}
|
|
|
|
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"`
|
|
}
|