cel

package
v0.0.0-...-d2452cb Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(exp string, input []byte) (bool, error)

Eval evaluates the cel expression against the given input. input is expected to be a json string

func EvalMap

func EvalMap(exp string, input map[string]any) (bool, error)

func EvalPB

func EvalPB(exp []byte, key string, input *structpb.Struct) (bool, error)

EvalPB evaluates the cel expression against the given input.

func Parse

func Parse(expression, description string) (*ast.AST, error)

Parse parses the given expression and returns the AST.

func ToProto

func ToProto(a *ast.AST) (*expr.CheckedExpr, error)

ToProto returns a checked expression or an error

Types

type EvalResponse

type EvalResponse struct {
	Result any     `json:"result"`
	Cost   *uint64 `json:"cost,omitempty"`
}

Jump to

Keyboard shortcuts

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