Documentation ¶
Index ¶
- type Runtime
- func (r *Runtime) CallFunction(source string, params ...interface{}) (otto.Value, error)
- func (r *Runtime) CallPromise(source string, params ...interface{}) (chan otto.Value, error)
- func (r *Runtime) CompleteKeywords(line string) []string
- func (r *Runtime) Do(fn func(*otto.Otto))
- func (r *Runtime) Exec(code string) (v otto.Value, err error)
- func (r *Runtime) ExecFunction(source string, params ...interface{}) (v otto.Value, err error)
- func (r *Runtime) ExecPromise(source string, params ...interface{}) (v otto.Value, err error)
- func (r *Runtime) RegisterAPIClient(client *shttp.CrudClient)
- func (r *Runtime) RunScript(path string) otto.Value
- func (r *Runtime) Start()
- func (r *Runtime) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶ added in v0.21.0
Runtime is a Skydive JavaScript runtime environment
func NewRuntime ¶ added in v0.21.0
NewRuntime returns a new JavaScript runtime environment
func (*Runtime) CallFunction ¶ added in v0.22.0
CallFunction takes the source of a function and evaluate it with the specified parameters
func (*Runtime) CallPromise ¶ added in v0.22.0
CallPromise takes the source of a promise and evaluate it with the specified parameters
func (*Runtime) CompleteKeywords ¶ added in v0.21.0
CompleteKeywords returns potential continuations for the given line. Since line is evaluated, callers need to make sure that evaluating line does not have side effects.
func (*Runtime) ExecFunction ¶ added in v0.22.0
ExecFunction queues a CallFunction method
func (*Runtime) ExecPromise ¶ added in v0.22.0
ExecPromise executes a promise and return its result
func (*Runtime) RegisterAPIClient ¶ added in v0.21.0
func (r *Runtime) RegisterAPIClient(client *shttp.CrudClient)
RegisterAPIClient exports Go function required by the API to run inside the client JS VM