Documentation
¶
Index ¶
- Constants
- func Plugins() map[string]IPlugin
- func RegisterPlugin(name string, m IPlugin)
- func UnRegisterPlugin(name string)
- type Engine
- type FormaterOption
- type FormaterOptions
- type FullScriptInfo
- type IPlugin
- type IPluginFactory
- type ISubPlugin
- type RunOption
- type RunOptions
- type ScriptEnhanceInputModel
- type ScriptFormater
Constants ¶
View Source
const V_INTERNAL_F = "V_INTERNAL_F"
View Source
const V_PARAM = "V_PARAM"
View Source
const V_RETURN = "V_RETURN"
View Source
const V_SCRIPT_NAME = "V_SCRIPT_NAME"
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶
func UnRegisterPlugin ¶
func UnRegisterPlugin(name string)
Types ¶
type Engine ¶
type Engine interface { // 检查tengo脚本是否存在编译错误 Compile(script string, opts ...RunOption) error // 执行tengo脚本,并从给定的返回变量名中获得返回值 Eval(script string, opts ...RunOption) (string, string, error) // 执行tengo脚本,并从给定的返回变量名中获得返回值 Run(script string, opts ...RunOption) (string, error) }
tengo脚本执行引擎
type FormaterOption ¶
type FormaterOption func(*FormaterOptions)
func FormaterEval ¶
func FormaterEval(enabled bool) FormaterOption
func FormaterFuncParams ¶
func FormaterFuncParams(params []string) FormaterOption
func FormaterImportModules ¶
func FormaterImportModules(importModules map[string]struct{}) FormaterOption
func FormaterLogID ¶
func FormaterLogID(logID string) FormaterOption
func FormaterModuleMap ¶
func FormaterModuleMap(moduleMap *tengo.ModuleMap) FormaterOption
type FormaterOptions ¶
type FormaterOptions struct { FuncParams []string LogID string Eval bool ImportModules map[string]struct{} ModuleMap *tengo.ModuleMap }
func NewFormaterOptions ¶
func NewFormaterOptions(opts ...FormaterOption) FormaterOptions
constructor
func (*FormaterOptions) OptionList ¶
func (o *FormaterOptions) OptionList() []FormaterOption
type FullScriptInfo ¶
type IPlugin ¶
type IPluginFactory ¶
type ISubPlugin ¶
type RunOptions ¶
type RunOptions struct { FuncParams []string FuncData map[string]interface{} OutputLog bool ShowSourceLine bool Eval bool }
func (*RunOptions) OptionList ¶
func (o *RunOptions) OptionList() []RunOption
type ScriptEnhanceInputModel ¶
type ScriptFormater ¶
type ScriptFormater interface { ToSourceModel(script string, opts ...FormaterOption) (*FullScriptInfo, error) ToScript(script string, opts ...FormaterOption) (*FullScriptInfo, error) }
func NewScriptFormater ¶
func NewScriptFormater() ScriptFormater
Click to show internal directories.
Click to hide internal directories.