engine

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: GPL-3.0 Imports: 12 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 Config added in v1.5.1

type Config struct {
	ProxyURL *url.URL
}

type Engine

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

func NewEngine

func NewEngine(cfg *Config) *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
inject
vm
xhr

Jump to

Keyboard shortcuts

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