Documentation
¶
Overview ¶
bexpr is an implementation of a generic boolean expression evaluator. The general goal is to be able to evaluate some expression against some arbitrary data and get back a boolean of whether or not the data was matched by the expression
Index ¶
- func CoerceBool(value string) (interface{}, error)
- func CoerceFloat32(value string) (interface{}, error)
- func CoerceFloat64(value string) (interface{}, error)
- func CoerceInt64(value string) (interface{}, error)
- func CoerceUint64(value string) (interface{}, error)
- type Evaluator
- type Filter
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoerceBool ¶
CoerceBool conforms to the FieldValueCoercionFn signature and can be used to convert the raw string value of an expression into a `bool`
func CoerceFloat32 ¶
CoerceFloat32 conforms to the FieldValueCoercionFn signature and can be used to convert the raw string value of an expression into an `float32`
func CoerceFloat64 ¶
CoerceFloat64 conforms to the FieldValueCoercionFn signature and can be used to convert the raw string value of an expression into an `float64`
func CoerceInt64 ¶
CoerceInt64 conforms to the FieldValueCoercionFn signature and can be used to convert the raw string value of an expression into an `int64`
func CoerceUint64 ¶
CoerceUint64 conforms to the FieldValueCoercionFn signature and can be used to convert the raw string value of an expression into an `int64`
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func CreateFilter ¶
Creates a filter to operate on the given data type. The data type passed can be either be a container type (map, slice or array) or the element type. For example, if you want to filter a []Foo then the data type to pass here is either []Foo or just Foo. If no expression is provided the nil filter will be returned but is not an error. This is done to allow for executing the nil filter which is just a no-op