add dynamic speed limit

fix old user limit info not clear
fix some wrong names
This commit is contained in:
yuzuki999
2022-09-07 23:02:02 +08:00
parent 52134c6e4e
commit 5fd09079e3
10 changed files with 211 additions and 130 deletions

View File

@@ -27,22 +27,31 @@ type IpReportConfig struct {
EnableIpSync bool `mapstructure:"EnableIpSync"`
}
type DynamicSpeedLimitConfig struct {
Periodic int `mapstructure:"Periodic"`
Traffic int64 `mapstructure:"Traffic"`
SpeedLimit uint64 `mapstructure:"SpeedLimit"`
ExpireTime int `mapstructure:"ExpireTime"`
}
type ControllerConfig struct {
ListenIP string `mapstructure:"ListenIP"`
SendIP string `mapstructure:"SendIP"`
UpdatePeriodic int `mapstructure:"UpdatePeriodic"`
EnableDNS bool `mapstructure:"EnableDNS"`
DNSType string `mapstructure:"DNSType"`
DisableUploadTraffic bool `mapstructure:"DisableUploadTraffic"`
DisableGetRule bool `mapstructure:"DisableGetRule"`
EnableProxyProtocol bool `mapstructure:"EnableProxyProtocol"`
EnableFallback bool `mapstructure:"EnableFallback"`
DisableIVCheck bool `mapstructure:"DisableIVCheck"`
DisableSniffing bool `mapstructure:"DisableSniffing"`
FallBackConfigs []*FallBackConfig `mapstructure:"FallBackConfigs"`
EnableIpRecorder bool `mapstructure:"EnableIpRecorder"`
IpRecorderConfig *IpReportConfig `mapstructure:"IpRecorderConfig"`
CertConfig *CertConfig `mapstructure:"CertConfig"`
ListenIP string `mapstructure:"ListenIP"`
SendIP string `mapstructure:"SendIP"`
UpdatePeriodic int `mapstructure:"UpdatePeriodic"`
EnableDNS bool `mapstructure:"EnableDNS"`
DNSType string `mapstructure:"DNSType"`
DisableUploadTraffic bool `mapstructure:"DisableUploadTraffic"`
DisableGetRule bool `mapstructure:"DisableGetRule"`
EnableProxyProtocol bool `mapstructure:"EnableProxyProtocol"`
EnableFallback bool `mapstructure:"EnableFallback"`
DisableIVCheck bool `mapstructure:"DisableIVCheck"`
DisableSniffing bool `mapstructure:"DisableSniffing"`
FallBackConfigs []*FallBackConfig `mapstructure:"FallBackConfigs"`
EnableIpRecorder bool `mapstructure:"EnableIpRecorder"`
IpRecorderConfig *IpReportConfig `mapstructure:"IpRecorderConfig"`
EnableDynamicSpeedLimit bool `mapstructure:"EnableDynamicSpeedLimit"`
DynamicSpeedLimitConfig *DynamicSpeedLimitConfig `mapstructure:"DynamicSpeedLimitConfig"`
CertConfig *CertConfig `mapstructure:"CertConfig"`
}
type ApiConfig struct {