func (rg *RuleGroup) FindByMsg(msg string) []*Rule {
	rules := []*Rule{}
	for _, r := range rg.rules {
		if r.Msg == msg {
			rules = append(rules, r)
		}
	}
	return rules
}
FindByMsg returns a slice of rules that matches the msg
package coraza
import (
	"fmt"
	"strconv"
	"sync"
	"time"
	"github.com/jptosso/coraza-waf/utils"
	"go.uber.org/zap"
)
type RuleGroup struct {
	rules []*Rule
	mux   *sync.RWMutex
}
func (rg *RuleGroup) Add(rule *Rule) error {
	if rule == nil {
		return nil
	}
	if rg.FindById(rule.Id) != nil && rule.Id != 0 {
		return fmt.Errorf("there is a another rule with id %d", rule.Id)
	}
	rg.rules = append(rg.rules, rule)
	return nil
}
func (rg *RuleGroup) GetRules() []*Rule {
	rg.mux.RLock()
	defer rg.mux.RUnlock()
	return rg.rules
}
func (rg *RuleGroup) FindById(id int) *Rule {
	for _, r := range rg.rules {
		if r.Id == id {
			return r
		}
	}
	return nil
}
func (rg *RuleGroup) DeleteById(id int) {
	for i, r := range rg.rules {
		if r != nil && r.Id == id {
			copy(rg.rules[i:], rg.rules[i+1:])
			rg.rules[len(rg.rules)-1] = nil
			rg.rules = rg.rules[:len(rg.rules)-1]
		}
	}
}