expr

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalBool added in v1.14.0

func EvalBool(zctx *zed.Context, val vector.Any, e Evaluator) (vector.Any, bool)

EvalBool evaluates e using val to computs a boolean result. For elements of the result that are not boolean, an error is calculated for each non-bool slot and they are returned as an error. If all of the value slots are errors, then the return value is nil.

func ToBool added in v1.14.0

func ToBool(val zed.Value) (bool, bool)

func ToFloat added in v1.14.0

func ToFloat(val zed.Value) (float64, bool)

func ToInt added in v1.14.0

func ToInt(val zed.Value) (int64, bool)

func ToUint added in v1.14.0

func ToUint(val zed.Value) (uint64, bool)

Types

type And added in v1.14.0

type And struct {
	// contains filtered or unexported fields
}

func NewLogicalAnd added in v1.14.0

func NewLogicalAnd(zctx *zed.Context, lhs, rhs Evaluator) *And

func (*And) Eval added in v1.14.0

func (a *And) Eval(val vector.Any) vector.Any

type Arith added in v1.17.0

type Arith struct {
	// contains filtered or unexported fields
}

func NewArith added in v1.17.0

func NewArith(zctx *zed.Context, lhs, rhs Evaluator, op string) *Arith

func (*Arith) Eval added in v1.17.0

func (a *Arith) Eval(val vector.Any) vector.Any

type Call added in v1.18.0

type Call struct {
	// contains filtered or unexported fields
}

func NewCall added in v1.18.0

func NewCall(fn Function, exprs []Evaluator) *Call

func (*Call) Eval added in v1.18.0

func (c *Call) Eval(this vector.Any) vector.Any

type Compare added in v1.14.0

type Compare struct {
	// contains filtered or unexported fields
}

func NewCompare added in v1.14.0

func NewCompare(zctx *zed.Context, lhs, rhs Evaluator, op string) *Compare

func (*Compare) Eval added in v1.14.0

func (c *Compare) Eval(val vector.Any) vector.Any

type DotExpr

type DotExpr struct {
	// contains filtered or unexported fields
}

func NewDotExpr

func NewDotExpr(zctx *zed.Context, record Evaluator, field string) *DotExpr

func (*DotExpr) Eval

func (d *DotExpr) Eval(vec vector.Any) vector.Any

type Evaluator

type Evaluator interface {
	Eval(vector.Any) vector.Any
}

func NewDottedExpr added in v1.14.0

func NewDottedExpr(zctx *zed.Context, f field.Path) Evaluator

func NewIndexExpr added in v1.18.0

func NewIndexExpr(zctx *zed.Context, container, index Evaluator) Evaluator

func NewRecordExpr added in v1.18.0

func NewRecordExpr(zctx *zed.Context, elems []RecordElem) Evaluator

type Function added in v1.18.0

type Function interface {
	Call(...vector.Any) vector.Any
}

type Index added in v1.18.0

type Index struct {
	// contains filtered or unexported fields
}

Index represents an index operator "container[index]" where container is either an array or set (with index type integer), or a record (with index type string), or a map (with any index type).

func (*Index) Eval added in v1.18.0

func (i *Index) Eval(this vector.Any) vector.Any

type Literal added in v1.14.0

type Literal struct {
	// contains filtered or unexported fields
}

func NewLiteral added in v1.14.0

func NewLiteral(val zed.Value) *Literal

func (Literal) Eval added in v1.14.0

func (l Literal) Eval(val vector.Any) vector.Any

type Not added in v1.14.0

type Not struct {
	// contains filtered or unexported fields
}

func NewLogicalNot added in v1.14.0

func NewLogicalNot(zctx *zed.Context, e Evaluator) *Not

func (*Not) Eval added in v1.14.0

func (n *Not) Eval(val vector.Any) vector.Any

type Or added in v1.14.0

type Or struct {
	// contains filtered or unexported fields
}

func NewLogicalOr added in v1.14.0

func NewLogicalOr(zctx *zed.Context, lhs, rhs Evaluator) *Or

func (*Or) Eval added in v1.14.0

func (o *Or) Eval(val vector.Any) vector.Any

type Putter added in v1.18.0

type Putter struct {
	// contains filtered or unexported fields
}

Putter adapts the behavior of recordExpr (obtained from NewRecordExpr) to match that of the put operator, which emits an error when an input value is not a record.

func NewPutter added in v1.18.0

func NewPutter(zctx *zed.Context, recordExpr Evaluator) *Putter

func (*Putter) Eval added in v1.18.0

func (p *Putter) Eval(vec vector.Any) vector.Any

type RecordElem added in v1.18.0

type RecordElem struct {
	Name string // "" means spread.
	Expr Evaluator
}

type Renamer added in v1.18.0

type Renamer struct {
	// contains filtered or unexported fields
}

Renamer renames one or more fields in a record. See expr.Renamer, on which it relies, for more detail.

func NewRenamer added in v1.18.0

func NewRenamer(zctx *zed.Context, srcs, dsts []*expr.Lval) *Renamer

func (*Renamer) Eval added in v1.18.0

func (r *Renamer) Eval(vec vector.Any) vector.Any

type This

type This struct{}

func (*This) Eval

func (*This) Eval(val vector.Any) vector.Any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL