script

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallFunc

func CallFunc(vm *otto.Otto, method string, timeout time.Duration, params ...interface{}) (value otto.Value, err error)

func Execute

func Execute(vm *otto.Otto, script string, timeout time.Duration) (value otto.Value, err error)

func LoadScript

func LoadScript(vm *otto.Otto, script string, timeout time.Duration) (err error)

Types

type JsEngine

type JsEngine interface {
	Invoke(method string, params ...interface{}) (otto.Value, error)
	Inject(name string, callback func(call otto.FunctionCall) otto.Value)
	SetValue(name string, value interface{}) error
}

func Create

func Create(javascript string) (engine JsEngine, err error)

func CreateWithTimeout

func CreateWithTimeout(javascript string, timeout time.Duration) (engine JsEngine, err error)

Jump to

Keyboard shortcuts

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