Documentation ¶
Overview ¶
nolint
copy https://github.com/jweny/pocassist/blob/master/pkg/cel/cel.go
Index ¶
- func Evaluate(env *cel.Env, expression string, params map[string]interface{}) (ref.Val, error)
- type CelController
- func (cc *CelController) Evaluate(char string) (bool, error)
- func (celController *CelController) InitCel(poc *xray.Poc) error
- func (cc *CelController) InitSet(poc *xray.Poc, newReq *proto.Request) (err error)
- func (cc *CelController) UpdateEnv()
- func (cc *CelController) UpdateRule(ruleName string, ruleResult bool)
- type CustomLib
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CelController ¶
type CelController struct { Env *cel.Env // cel env ParamMap map[string]interface{} // 注入到cel中的变量 Option CustomLib // }
func (*CelController) Evaluate ¶
func (cc *CelController) Evaluate(char string) (bool, error)
计算cel表达式
func (*CelController) InitCel ¶
func (celController *CelController) InitCel(poc *xray.Poc) error
初始化env
func (*CelController) UpdateEnv ¶
func (cc *CelController) UpdateEnv()
func (*CelController) UpdateRule ¶
func (cc *CelController) UpdateRule(ruleName string, ruleResult bool)
type CustomLib ¶
type CustomLib struct {
// contains filtered or unexported fields
}
func InitCelOptions ¶
func InitCelOptions() CustomLib
func (*CustomLib) AddRuleSetOptions ¶
func (c *CustomLib) AddRuleSetOptions(args []yaml.MapItem)
如果有set:追加set变量到 cel options
func (*CustomLib) CompileOptions ¶
func (*CustomLib) ProgramOptions ¶
func (c *CustomLib) ProgramOptions() []cel.ProgramOption
Click to show internal directories.
Click to hide internal directories.