engine

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(script string) (value any, err error)

Types

type Engine

type Engine struct {
	Runtime *goja.Runtime
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine() *Engine

func (*Engine) CallFunction

func (e *Engine) CallFunction(fn goja.Callable, args ...any) (value any, err error)

CallFunction calls the function and returns the go type value if function result is promise, it will be resolved

func (*Engine) Close

func (e *Engine) Close()

func (*Engine) RunString

func (e *Engine) RunString(script string) (value any, err error)

RunString executes the script and returns the go type value if script result is promise, it will be resolved

Directories

Path Synopsis
xhr

Jump to

Keyboard shortcuts

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