evaluator

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CEL

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

CEL is an implementation of Evaluator that uses CEL expressions.

func NewCEL

func NewCEL(data map[string]map[string]any) (*CEL, error)

NewCEL returns a new instance of CEL evaluator.

func (*CEL) Evaluate

func (e *CEL) Evaluate(expression string) (string, error)

Evaluate evaluates the given expression using Google CEL, and returns its result, plus an error, if any.

It expects the final value to be one of types: "string", "int", "uint", "double", "bool".

Jump to

Keyboard shortcuts

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