exprlang

package module
v0.0.0-...-ed1408d Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package exprlang 用 expr-lang 实现 flow.ExpressionEvaluator, 与 go-wind-oa / go-wind-im 现有网关条件求值行为保持一致。

用法:

eng := flow.New(flow.WithStore(memory.New()), flow.WithEvaluator(exprlang.New()))

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

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

Evaluator flow.ExpressionEvaluator 的 expr-lang 实现。

func New

func New(opts ...expr.Option) *Evaluator

New 创建求值器。可传入额外编译选项(默认已锁定 Env 为变量 map、 要求布尔结果——与核心 SimpleEvaluator 同语义)。

func (*Evaluator) EvalAny

func (e *Evaluator) EvalAny(_ context.Context, expression string, env flow.Vars) (any, error)

EvalAny 实现 flow.ValueEvaluator:求值非布尔表达式(多实例 collection 等)。

func (*Evaluator) EvalBool

func (e *Evaluator) EvalBool(ctx context.Context, expression string, env flow.Vars) (bool, error)

Jump to

Keyboard shortcuts

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