expression

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package expression provides expression evaluation capabilities for conditional execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFunctions added in v0.5.0

func AllFunctions() map[string]interface{}

AllFunctions returns all custom functions combined

func CollectionFunctions added in v0.5.0

func CollectionFunctions() map[string]interface{}

CollectionFunctions returns array/collection functions

func MathFunctions added in v0.5.0

func MathFunctions() map[string]interface{}

MathFunctions returns mathematical functions

func StringFunctions added in v0.5.0

func StringFunctions() map[string]interface{}

StringFunctions returns string manipulation functions

func TypeFunctions added in v0.5.0

func TypeFunctions() map[string]interface{}

TypeFunctions returns type checking functions

func UtilityFunctions added in v0.5.0

func UtilityFunctions() map[string]interface{}

UtilityFunctions returns utility functions

Types

type Evaluator

type Evaluator interface {
	Evaluate(expression string, variables map[string]interface{}) (interface{}, error)
}

Evaluator defines the interface for evaluating expressions

func NewExprEvaluator added in v0.5.0

func NewExprEvaluator() Evaluator

NewExprEvaluator creates a new ExprEvaluator.

func NewGovaluateEvaluator

func NewGovaluateEvaluator() Evaluator

NewGovaluateEvaluator is kept for backwards compatibility, now returns ExprEvaluator.

type ExprEvaluator added in v0.5.0

type ExprEvaluator struct {
}

ExprEvaluator implements Evaluator using the expr-lang library.

func (*ExprEvaluator) Evaluate added in v0.5.0

func (e *ExprEvaluator) Evaluate(expression string, variables map[string]interface{}) (interface{}, error)

Evaluate evaluates an expression with the given variables

Jump to

Keyboard shortcuts

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