实现WAF部分功能

This commit is contained in:
GoEdgeLab
2020-10-07 11:18:24 +08:00
parent 608777480d
commit 0b50f7beec
7 changed files with 1218 additions and 165 deletions

View File

@@ -26,3 +26,23 @@ func (this *HTTPFirewallInboundConfig) FindGroupWithCode(code string) *HTTPFirew
}
return nil
}
// 删除某个分组
func (this *HTTPFirewallInboundConfig) 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
}