mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-01-08 13:25:48 +08:00
19 lines
569 B
Go
19 lines
569 B
Go
package firewallconfigs
|
|
|
|
type HTTPFirewallRegionConfig struct {
|
|
IsOn bool `yaml:"isOn" json:"isOn"`
|
|
DenyCountryIds []int64 `yaml:"denyCountryIds" json:"denyCountryIds"` // 封禁的国家|地区
|
|
DenyProvinceIds []int64 `yaml:"denyProvinceIds" json:"denyProvinceIds"` // 封禁的省或自治区
|
|
|
|
isNotEmpty bool
|
|
}
|
|
|
|
func (this *HTTPFirewallRegionConfig) Init() error {
|
|
this.isNotEmpty = len(this.DenyCountryIds) > 0 || len(this.DenyProvinceIds) > 0
|
|
return nil
|
|
}
|
|
|
|
func (this *HTTPFirewallRegionConfig) IsNotEmpty() bool {
|
|
return this.isNotEmpty
|
|
}
|