ast

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

package ast provides methods for constructing CEL abstract syntax nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCall

func NewCall(id int64, name string, target *expr.Expr, args []*expr.Expr) *expr.Expr

Create a function call expression from the function name, optional receiver, arguments, and id.

All operators and user-defined functions are modelled as calls. For a list of built-in operators (restrictions), see the operators/operators.go file.

func NewConst

func NewConst(id int64, value interface{}) *expr.Expr

Create a constant from the primitive value with the given id.

func NewIdent

func NewIdent(id int64, name string) *expr.Expr

Create an identifier from the given name and id.

Identifiers may either refer to a property that can be filtered within the API, or unquoted text. Interpretation of an identifier is highly contextual.

Within CEL, type-checking asserts that all identifiers must be declared. To use type-checking with filters, a second processing step may be used to convert unknown identifiers to constant strings prior to the type-check. This may be desired as an algorithmic way for validating filters.

func NewSelect

func NewSelect(id int64, operand *expr.Expr, field string) *expr.Expr

Create a select field expression from the operand, field name, and id.

Selection occurs via the dot operator, but there is also an index expression which permits the selection of a field with non-identifier characters in it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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