A simple, but expandable, rules engine for Go
contains
and ncontains
now support strings instead of just slices. This is magnitudes faster than using the regex
comparator for the same functionality.
regex
comparatorIn this release we remove support for creating a new Engine without JSON. We force users to use JSON because there is special function of our unmarshal that provides a massive speedup when using noneof
or oneof
.
Contains
, NotContains
, OneOf
, NotOneOf
false
from any comparator which is trying to compare two values of different types. For instance, checking if a []string
contains a float64
will return false
; this used to return true
.With this release, we introduce a new comparator ncontains, which will return true if a is not contained in b.
Bug Fix:
In this release we drop support for all types other than string
and float64
. This was done in order to play more nicely with encoding/json
.
For more information: https://golang.org/pkg/encoding/json/#Token
Bug Fixes
This release contains a bug fix that impacted that gte
and gt
comparators. In short, the gte
and gt
functions returned true if the types did not match.
This provides enhancement in the contains function; type asserting to slices of interfaces instead of the perceived type.
oneof
comparator