Documentation ¶
Index ¶
- Variables
- type And
- type Arg
- type Call
- type Cmp
- type CmpOp
- type CreateArray
- type CreateObject
- type Current
- type Evaluator
- func (e Evaluator[T]) Eval(node Node, obj T) T
- func (e Evaluator[T]) EvalAnd(node *And, obj T) T
- func (e Evaluator[T]) EvalCall(node *Call, obj T) T
- func (e Evaluator[T]) EvalCmp(node *Cmp, obj T) T
- func (e Evaluator[T]) EvalCreateArray(node *CreateArray, obj T) T
- func (e Evaluator[T]) EvalCreateObject(node *CreateObject, obj T) T
- func (e Evaluator[T]) EvalCurrent(node *Current, obj T) T
- func (e Evaluator[T]) EvalExprRef(node *ExprRef, obj T) T
- func (e Evaluator[T]) EvalFlattenArray(node *FlattenArray, obj T) T
- func (e Evaluator[T]) EvalFlattenObject(node *FlattenObject, obj T) T
- func (e Evaluator[T]) EvalIndex(node *Index, obj T) T
- func (e Evaluator[T]) EvalJsonLiteral(node *JsonLiteral, obj T) T
- func (e Evaluator[T]) EvalNegate(node *Negate, obj T) T
- func (e Evaluator[T]) EvalOr(node *Or, obj T) T
- func (e Evaluator[T]) EvalParameter(node *Parameter, obj T) T
- func (e Evaluator[T]) EvalProject(node *Project, obj T) T
- func (e Evaluator[T]) EvalProperty(node *Property, obj T) T
- func (e Evaluator[T]) EvalSelection(node *Selection, obj T) T
- func (e Evaluator[T]) EvalSequence(node *Sequence, obj T) T
- func (e Evaluator[T]) EvalSlice(node *Slice, obj T) T
- func (e Evaluator[T]) EvalString(node *String, obj T) T
- type ExprRef
- type FlattenArray
- type FlattenObject
- type Function
- type Index
- type JsonLiteral
- type Leaf
- type NameTarget
- type Negate
- type Node
- type NumberTarget
- type Op
- type Or
- type Parameter
- type Project
- type Property
- type Runtime
- type Selection
- type Sequence
- type SimpleRuntime
- func (r *SimpleRuntime) AddFunctions(fns ...Function)
- func (r SimpleRuntime) Compare(o CmpOp, left, right any) any
- func (r SimpleRuntime) CreateArray(items []any) any
- func (r SimpleRuntime) CreateBool(value bool) any
- func (r SimpleRuntime) CreateNull() any
- func (r SimpleRuntime) CreateObject(fields map[string]any) any
- func (r SimpleRuntime) CreateStr(val string) any
- func (r SimpleRuntime) GetNameVar(name string) any
- func (r SimpleRuntime) GetNumVar(num int) any
- func (r SimpleRuntime) GetProperty(obj any, field string) any
- func (r SimpleRuntime) GetType(obj any) ValueType
- func (r SimpleRuntime) InvokeFunction(name string, args []Arg[any]) any
- func (r SimpleRuntime) IsNull(obj any) bool
- func (r SimpleRuntime) IsTruthy(obj any) bool
- func (r SimpleRuntime) ParseStr(s string) any
- func (r SimpleRuntime) ToIterable(obj any) []any
- type Slice
- type String
- type Target
- type ValueType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CreateArray ¶
type CreateArray struct { Items []Node // contains filtered or unexported fields }
type CreateObject ¶
type Evaluator ¶
type Evaluator[T any] struct { // contains filtered or unexported fields }
func (Evaluator[T]) EvalCreateArray ¶
func (e Evaluator[T]) EvalCreateArray(node *CreateArray, obj T) T
func (Evaluator[T]) EvalCreateObject ¶
func (e Evaluator[T]) EvalCreateObject(node *CreateObject, obj T) T
func (Evaluator[T]) EvalCurrent ¶
func (Evaluator[T]) EvalExprRef ¶
func (Evaluator[T]) EvalFlattenArray ¶
func (e Evaluator[T]) EvalFlattenArray(node *FlattenArray, obj T) T
func (Evaluator[T]) EvalFlattenObject ¶
func (e Evaluator[T]) EvalFlattenObject(node *FlattenObject, obj T) T
func (Evaluator[T]) EvalJsonLiteral ¶
func (e Evaluator[T]) EvalJsonLiteral(node *JsonLiteral, obj T) T
func (Evaluator[T]) EvalNegate ¶
func (Evaluator[T]) EvalParameter ¶
func (Evaluator[T]) EvalProject ¶
func (Evaluator[T]) EvalProperty ¶
func (Evaluator[T]) EvalSelection ¶
func (Evaluator[T]) EvalSequence ¶
func (Evaluator[T]) EvalString ¶
type FlattenArray ¶
type FlattenArray struct {
// contains filtered or unexported fields
}
type FlattenObject ¶
type FlattenObject struct {
// contains filtered or unexported fields
}
type JsonLiteral ¶
type JsonLiteral struct { Text string // contains filtered or unexported fields }
type NameTarget ¶
type NameTarget string
type NumberTarget ¶
type NumberTarget int
type Runtime ¶
type Runtime[T any] interface { IsTruthy(obj T) bool GetType(obj T) ValueType IsNull(obj T) bool CreateNull() T Compare(o CmpOp, left, right T) T CreateArray(items []T) T CreateObject(fields map[string]T) T ToIterable(obj T) []T InvokeFunction(name string, args []Arg[T]) T CreateBool(value bool) T GetProperty(obj T, field string) T ParseStr(s string) T CreateStr(val string) T GetNumVar(num int) T GetNameVar(name string) T }
type SimpleRuntime ¶
type SimpleRuntime struct {
// contains filtered or unexported fields
}
func (*SimpleRuntime) AddFunctions ¶
func (r *SimpleRuntime) AddFunctions(fns ...Function)
func (SimpleRuntime) CreateArray ¶
func (r SimpleRuntime) CreateArray(items []any) any
func (SimpleRuntime) CreateBool ¶
func (r SimpleRuntime) CreateBool(value bool) any
func (SimpleRuntime) CreateNull ¶
func (r SimpleRuntime) CreateNull() any
func (SimpleRuntime) CreateObject ¶
func (r SimpleRuntime) CreateObject(fields map[string]any) any
func (SimpleRuntime) CreateStr ¶
func (r SimpleRuntime) CreateStr(val string) any
func (SimpleRuntime) GetNameVar ¶
func (r SimpleRuntime) GetNameVar(name string) any
func (SimpleRuntime) GetNumVar ¶
func (r SimpleRuntime) GetNumVar(num int) any
func (SimpleRuntime) GetProperty ¶
func (r SimpleRuntime) GetProperty(obj any, field string) any
func (SimpleRuntime) GetType ¶
func (r SimpleRuntime) GetType(obj any) ValueType
func (SimpleRuntime) InvokeFunction ¶
func (r SimpleRuntime) InvokeFunction(name string, args []Arg[any]) any
func (SimpleRuntime) IsNull ¶
func (r SimpleRuntime) IsNull(obj any) bool
func (SimpleRuntime) IsTruthy ¶
func (r SimpleRuntime) IsTruthy(obj any) bool
func (SimpleRuntime) ParseStr ¶
func (r SimpleRuntime) ParseStr(s string) any
func (SimpleRuntime) ToIterable ¶
func (r SimpleRuntime) ToIterable(obj any) []any
Source Files ¶
Click to show internal directories.
Click to hide internal directories.