celctx

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContextUnpack             = errors.New("context unpacking error")
	ErrEnvCreation               = errors.New("CEL environment creation error")
	ErrExpressionCompilation     = errors.New("CEL expression compilation error")
	ErrProgramConstruction       = errors.New("program construction error")
	ErrProgramEvaluation         = errors.New("program evaluation error")
	ErrInvalidReturnType         = errors.New("invalid return type")
	ErrDuplicateCELConditionName = errors.New("duplicate CEL condition name")
	ErrCELConditionEvaluation    = errors.New("CEL condition evaluation failed")
	ErrInvalidCELConditionName   = errors.New("invalid CEL condition name")
)

Functions

This section is empty.

Types

type CelCtx

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

CelCtx contains a cel environment that is prepared with a tmplCtx and pre-evaluated conditions.

func New

New pre-evaluates the given named conditions against tmplCtx and exposes both tmplCtx + named condition results to cel programs.

func (*CelCtx) Evaluate

func (cc *CelCtx) Evaluate(expr string) (bool, error)

Evaluate CEL expressions against the prepared template context and condition results.

Jump to

Keyboard shortcuts

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