cel

package
v0.0.0-...-269099d Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error)

计算单个表达式

func InitCelEnv

func InitCelEnv(c *CustomLib) (*cel.Env, error)

第二步 根据cel options 创建 cel环境

Types

type CustomLib

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

func InitCelOptions

func InitCelOptions() CustomLib

第一步定义 cel options

func (*CustomLib) AddRuleSetOptions

func (c *CustomLib) AddRuleSetOptions(args []yaml.MapItem)

如果有set:追加set变量到 cel options

func (*CustomLib) CompileOptions

func (c *CustomLib) CompileOptions() []cel.EnvOption

func (*CustomLib) ProgramOptions

func (c *CustomLib) ProgramOptions() []cel.ProgramOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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