javascript

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncList []*FuncInfo
)

Functions

func AddFunc

func AddFunc(funcInfo *FuncInfo)

func NewContext

func NewContext() map[string]interface{}

func Run

func Run(str string, context map[string]interface{}) (res interface{}, err error)

func RunScript added in v0.0.4

func RunScript(str string, context map[string]interface{}) (res interface{}, err error)

Types

type FuncInfo

type FuncInfo struct {
	Name     string         `json:"name"`
	Comment  string         `json:"comment"`
	Params   []*FuncVarInfo `json:"params"`
	Return   *FuncVarInfo   `json:"return"`
	HasError bool           `json:"hasError"`
	Func     interface{}    `json:"-"`
}

type FuncVarInfo

type FuncVarInfo struct {
	Name    string `json:"name"`
	Comment string `json:"comment"`
	Type    string `json:"type"`
}

type Script

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

func NewScript

func NewScript() (script *Script, err error)

func NewScriptByParent

func NewScriptByParent(parent *Script) (script *Script, err error)

func (*Script) GetScriptValue

func (this_ *Script) GetScriptValue(script string) (value interface{}, err error)

func (*Script) GetStringScriptValue

func (this_ *Script) GetStringScriptValue(script string) (value string, err error)

func (*Script) Set

func (this_ *Script) Set(name string, value interface{}) (err error)

Jump to

Keyboard shortcuts

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