dashboard/settings/type.go

70 lines
1.9 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"`
*UnisConfig `mapstructure:"unis"`
}
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 UnisConfig struct {
Instances int `mapstructure:"instances"`
*RpcConfig `mapstructure:"rpc"`
*HttpClientConfig `mapstructure:"httpc"`
}
type RpcConfig struct {
BasePort int `mapstructure:"base_port"`
Network string `mapstructure:"network"`
Host string `mapstructure:"host"`
Type string `mapstructure:"type"`
}
type HttpClientConfig struct {
Clients int `mapstructure:"clients"`
}
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"`
}