(waf *WAF)
| 25 | } |
| 26 | |
| 27 | func (this *RuleGroup) Init(waf *WAF) error { |
| 28 | this.hasRuleSets = len(this.RuleSets) > 0 |
| 29 | |
| 30 | if this.hasRuleSets { |
| 31 | for _, set := range this.RuleSets { |
| 32 | err := set.Init(waf) |
| 33 | if err != nil { |
| 34 | return fmt.Errorf("init set '%d' failed: %w", set.Id, err) |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | return nil |
| 39 | } |
| 40 | |
| 41 | func (this *RuleGroup) AddRuleSet(ruleSet *RuleSet) { |
| 42 | this.RuleSets = append(this.RuleSets, ruleSet) |