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
}
Adds a rule to the collection
Will return an error if the ID is already used
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
}