expr

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce added in v0.21.0

func Coalesce() cel.EnvOption

Coalesce removes all null values from a list.

func Compile

func Compile(source string) (cel.Program, error)

Compile takes a CEL expression and compiles it with the standard environment. We don't have anything in the standard environment just yet, but this ensures we instantiate the CEL VM consistently, wherever we might use it.

func Eval

func Eval[ReturnType any](ctx context.Context, prg cel.Program, scope map[string]any) (result ReturnType, err error)

Eval evaluates the given program against the scope, returning a value that matches the type requested via the generic ReturnType parameter.

func First added in v0.21.0

func First() cel.EnvOption

First returns the first value of a list element, if it exists.

func Pluck added in v0.21.0

func Pluck() cel.EnvOption

Pluck is a function that given a list of object, will map over those objects and return the values at the provided key.

func Replace added in v1.3.0

func Replace() cel.EnvOption

Replace removes the given string from the front of the input.

func Stdlib added in v0.21.0

func Stdlib() cel.EnvOption

Stdlib adds importer specific library functions to the CEL runtime.

func TrimPrefix added in v0.21.0

func TrimPrefix() cel.EnvOption

TrimPrefix removes the given string from the front of the input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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