V2bX/conf/limit.go

41 lines
1.4 KiB
Go
Raw Normal View History

2023-07-29 06:47:47 -04:00
package conf
type LimitConfig struct {
2023-08-20 03:13:52 -04:00
EnableRealtime bool `json:"EnableRealtime"`
SpeedLimit int `json:"SpeedLimit"`
IPLimit int `json:"DeviceLimit"`
ConnLimit int `json:"ConnLimit"`
EnableIpRecorder bool `json:"EnableIpRecorder"`
IpRecorderConfig *IpReportConfig `json:"IpRecorderConfig"`
EnableDynamicSpeedLimit bool `json:"EnableDynamicSpeedLimit"`
DynamicSpeedLimitConfig *DynamicSpeedLimitConfig `json:"DynamicSpeedLimitConfig"`
2023-07-29 06:47:47 -04:00
}
type RecorderConfig struct {
2023-08-20 03:13:52 -04:00
Url string `json:"Url"`
Token string `json:"Token"`
Timeout int `json:"Timeout"`
2023-07-29 06:47:47 -04:00
}
type RedisConfig struct {
2023-08-20 03:13:52 -04:00
Address string `json:"Address"`
Password string `json:"Password"`
Db int `json:"Db"`
2023-07-29 06:47:47 -04:00
Expiry int `json:"Expiry"`
}
type IpReportConfig struct {
2023-08-20 03:13:52 -04:00
Periodic int `json:"Periodic"`
Type string `json:"Type"`
RecorderConfig *RecorderConfig `json:"RecorderConfig"`
RedisConfig *RedisConfig `json:"RedisConfig"`
EnableIpSync bool `json:"EnableIpSync"`
2023-07-29 06:47:47 -04:00
}
type DynamicSpeedLimitConfig struct {
2023-08-20 03:13:52 -04:00
Periodic int `json:"Periodic"`
Traffic int64 `json:"Traffic"`
SpeedLimit int `json:"SpeedLimit"`
ExpireTime int `json:"ExpireTime"`
2023-07-29 06:47:47 -04:00
}