Documentation
¶
Index ¶
- Variables
- func DumpAST(expr Expr, depth int) string
- func ToFloat(v Value) (float64, error)
- type AbortExpr
- type Argument
- type ArrayExpr
- type ArrayValue
- type AssignExpr
- type BinaryExpr
- type BoolLit
- type BoolValue
- type CallExpr
- type DelExpr
- type EvalContext
- type Expr
- type FloatLit
- type FloatValue
- type ForExpr
- type IdentExpr
- type IfExpr
- type IndexExpr
- type IntLit
- type IntegerValue
- type JSONNodeValue
- type KVPair
- type Node
- type NullLit
- type NullValue
- type ObjectExpr
- type ObjectValue
- type Path
- type PathExpr
- type PathRoot
- type PathSegment
- type Position
- type RegexLit
- type RegexValue
- type Segment
- type StringLit
- type StringValue
- type Target
- type TimestampLit
- type TimestampValue
- type UnaryExpr
- type Value
- type ValueKind
Constants ¶
This section is empty.
Variables ¶
View Source
var AbortError = errors.New("abort")
Functions ¶
Types ¶
type ArrayValue ¶
type ArrayValue struct{ V []Value }
func (ArrayValue) AsBool ¶
func (ArrayValue) AsBool() bool
func (ArrayValue) Equal ¶
func (v ArrayValue) Equal(other Value) bool
func (ArrayValue) Kind ¶
func (ArrayValue) Kind() ValueKind
func (ArrayValue) String ¶
func (v ArrayValue) String() string
type AssignExpr ¶
func (*AssignExpr) Eval ¶
func (e *AssignExpr) Eval(ctx EvalContext) (Value, error)
type BinaryExpr ¶
func (*BinaryExpr) Eval ¶
func (e *BinaryExpr) Eval(ctx EvalContext) (Value, error)
type EvalContext ¶
type FloatValue ¶
type FloatValue struct{ V float64 }
func (FloatValue) AsBool ¶
func (FloatValue) AsBool() bool
func (FloatValue) Equal ¶
func (v FloatValue) Equal(other Value) bool
func (FloatValue) Kind ¶
func (FloatValue) Kind() ValueKind
func (FloatValue) String ¶
func (v FloatValue) String() string
type IntegerValue ¶
type IntegerValue struct{ V int64 }
func (IntegerValue) AsBool ¶
func (IntegerValue) AsBool() bool
func (IntegerValue) Equal ¶
func (v IntegerValue) Equal(other Value) bool
func (IntegerValue) Kind ¶
func (IntegerValue) Kind() ValueKind
func (IntegerValue) String ¶
func (v IntegerValue) String() string
type JSONNodeValue ¶
type JSONNodeValue struct{ N *insaneJSON.Node }
func (JSONNodeValue) AsBool ¶
func (v JSONNodeValue) AsBool() bool
func (JSONNodeValue) Equal ¶
func (v JSONNodeValue) Equal(other Value) bool
func (JSONNodeValue) Kind ¶
func (v JSONNodeValue) Kind() ValueKind
func (JSONNodeValue) String ¶
func (v JSONNodeValue) String() string
type ObjectExpr ¶
func (*ObjectExpr) Eval ¶
func (e *ObjectExpr) Eval(ctx EvalContext) (Value, error)
type ObjectValue ¶
func (ObjectValue) AsBool ¶
func (ObjectValue) AsBool() bool
func (ObjectValue) Equal ¶
func (v ObjectValue) Equal(other Value) bool
func (ObjectValue) Kind ¶
func (ObjectValue) Kind() ValueKind
func (ObjectValue) String ¶
func (v ObjectValue) String() string
type Path ¶
type Path struct {
Root PathRoot // EventRoot (.field) or MetadataRoot (%field)
Segments []Segment // empty == event root or metadata root
}
Path is a fully-resolved runtime path produced by the interpreter after evaluating any dynamic index expressions inside PathExpr.
type PathExpr ¶
type PathExpr struct {
Node
Root PathRoot
Segments []PathSegment
}
type PathSegment ¶
func (PathSegment) IsField ¶
func (s PathSegment) IsField() bool
func (PathSegment) IsIndex ¶
func (s PathSegment) IsIndex() bool
type RegexValue ¶
func (RegexValue) AsBool ¶
func (RegexValue) AsBool() bool
func (RegexValue) Equal ¶
func (v RegexValue) Equal(other Value) bool
func (RegexValue) Kind ¶
func (RegexValue) Kind() ValueKind
func (RegexValue) String ¶
func (v RegexValue) String() string
type Segment ¶
type Segment struct {
Field string // .fieldname - active when IsIndex is false
Idx int // [n] - active when IsIndex is true; negative == from end
}
Segment is a single resolved step in a runtime path. Exactly one mode is active per segment.
type StringValue ¶
type StringValue struct{ V string }
func (StringValue) AsBool ¶
func (StringValue) AsBool() bool
func (StringValue) Equal ¶
func (v StringValue) Equal(other Value) bool
func (StringValue) Kind ¶
func (StringValue) Kind() ValueKind
func (StringValue) String ¶
func (v StringValue) String() string
type Target ¶
type Target interface {
// Get retrieves the value at path.
Get(path Path) (Value, error)
// Set writes value at path, creating missing nodes as needed.
Set(path Path, value Value) error
// Delete removes the node at path. No-op when the path does not exist.
Delete(path Path) error
}
Abstraction over the event being processed.
The interpreter accesses all data exclusively through this interface.
type TimestampLit ¶
func (*TimestampLit) Eval ¶
func (e *TimestampLit) Eval(_ EvalContext) (Value, error)
type TimestampValue ¶
func (TimestampValue) AsBool ¶
func (TimestampValue) AsBool() bool
func (TimestampValue) Equal ¶
func (v TimestampValue) Equal(other Value) bool
func (TimestampValue) Kind ¶
func (TimestampValue) Kind() ValueKind
func (TimestampValue) String ¶
func (v TimestampValue) String() string
type Value ¶
func JsonNodeToValue ¶
func JsonNodeToValue(node *insaneJSON.Node) Value
JsonNodeToValue converts a single insaneJSON node to a Value. The conversion is recursive for arrays and objects.
Click to show internal directories.
Click to hide internal directories.