cel

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionalFilter

type ConditionalFilter struct {
	Expression *cel.Program
	Variables  []Variable
}

ConditionalFilter structure holds both CEL Program and variable definitions so that it can be evaluated with the new variable values

func CompileExpression

func CompileExpression(expression string) (ConditionalFilter, error)

CompileExpression accepts the expression string from the Filter spec, parses variables and their types, compiles expression into CEL Program

func (*ConditionalFilter) Filter

Filter parses Event payload values defined as the expression variables, asserts their types, and executes CEL Program. If expression result is true, Event passes the filter.

type Variable

type Variable struct {
	Name string
	Path string
	Type string
}

Variable contains the meta data required to parse event payload and execute CEL Program

Jump to

Keyboard shortcuts

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