evaluator

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvaluateConditions

func EvaluateConditions(msg hermod.Message, conditions []map[string]any) bool

func EvaluateField

func EvaluateField(msg hermod.Message, field string) any

func GetMsgValByPath

func GetMsgValByPath(msg hermod.Message, path string) any

func GetValByPath

func GetValByPath(data map[string]any, path string) any

func ResolveTemplate

func ResolveTemplate(temp string, data map[string]any) string

ResolveTemplate replaces every {{ ... }} token in temp with the value resolved from data (or env/expressions). It performs a single forward pass: resolved values are written to the output and never re-scanned. This keeps resolution bounded and prevents both template injection and the infinite loop that occurs when a resolved value itself contains a self-referential {{ ... }} token (e.g. data field "a" whose value is literally "{{a}}").

func SetValByPath

func SetValByPath(data map[string]any, path string, val any)

func ToBool

func ToBool(val any) bool

func ToFloat64

func ToFloat64(val any) (float64, bool)

func ToInt64

func ToInt64(val any) (int64, bool)

func ToTime

func ToTime(val any) (time.Time, bool)

Types

type Evaluator

type Evaluator struct {
}

Evaluator manages expression evaluation.

func NewEvaluator

func NewEvaluator() *Evaluator

func (*Evaluator) CallFunction

func (e *Evaluator) CallFunction(name string, args []any) any

func (*Evaluator) EvaluateAdvancedExpression

func (e *Evaluator) EvaluateAdvancedExpression(msg hermod.Message, expr any) any

func (*Evaluator) ParseAndEvaluate

func (e *Evaluator) ParseAndEvaluate(msg hermod.Message, expr string) any

type OutboxTransactionalSource

type OutboxTransactionalSource struct {
	hermod.Source
}

func (*OutboxTransactionalSource) Begin

func (*OutboxTransactionalSource) Commit

func (*OutboxTransactionalSource) Rollback

Jump to

Keyboard shortcuts

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