mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-18 00:55:19 +08:00
实现WAF部分功能
This commit is contained in:
@@ -26,3 +26,23 @@ func (this *HTTPFirewallOutboundConfig) FindGroupWithCode(code string) *HTTPFire
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 删除某个分组
|
||||
func (this *HTTPFirewallOutboundConfig) RemoveRuleGroup(groupId int64) {
|
||||
groups := []*HTTPFirewallRuleGroup{}
|
||||
refs := []*HTTPFirewallRuleGroupRef{}
|
||||
for _, g := range this.Groups {
|
||||
if g.Id == groupId {
|
||||
continue
|
||||
}
|
||||
groups = append(groups, g)
|
||||
}
|
||||
for _, ref := range this.GroupRefs {
|
||||
if ref.GroupId == groupId {
|
||||
continue
|
||||
}
|
||||
refs = append(refs, ref)
|
||||
}
|
||||
this.Groups = groups
|
||||
this.GroupRefs = refs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user