script

package
v1.1.23 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistsCode

func ExistsCode(name string) bool

func InitPool

func InitPool(poolMinLen, poolMaxLen int, api map[string]any) error

InitPool 初始化规则引擎池

@param poolMinLen 最小容量
@param poolMaxLen 最大容量
@param api 注入的API
@return error

func RegisterApi

func RegisterApi(api map[string]any)

RegisterApi 向引擎池注册公共API

@param api

func RegisterCode

func RegisterCode(name string, code string)

RegisterCode 注册代码

@param name 规则名称 一般是nodeID
@param code 代码

func RunCode

func RunCode(name string, env map[string]any) (out any, err error)

RunCode 执行代码

@param name
@param env

func UpdateCode

func UpdateCode() error

UpdateCode 全量更新池子里的代码

@return error

Types

This section is empty.

Jump to

Keyboard shortcuts

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