package rule import "github.com/expr-lang/expr" type Options struct { Rules []string Expr []expr.Option } type OptionFunc func(opts *Options) func NewOptions(funcs ...OptionFunc) *Options { opts := &Options{ Expr: make([]expr.Option, 0), Rules: make([]string, 0), } for _, fn := range funcs { fn(opts) } return opts } func WithRules(rules ...string) OptionFunc { return func(opts *Options) { opts.Rules = rules } } func WithExpr(options ...expr.Option) OptionFunc { return func(opts *Options) { opts.Expr = options } }