jsengine

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEngine

func AddEngine(name string, gen genfunc) bool

AddEngine adds JavaScript engine to common registry Because some of the JS engines, like the V8 engine, are optionally built with compile tags, this tracks which drivers are actually avalible

Types

type JSEngine

type JSEngine interface {
	CallDict(input ...map[string]interface{}) (map[string]interface{}, error)
	CallBool(input ...map[string]interface{}) (bool, error)
	CallString(input ...map[string]interface{}) (string, error)
}

JSEngine is the common JavaScript engine interface

func NewJSEngine

func NewJSEngine(code string, imports []string) (JSEngine, error)

NewJSEngine creates a new JavaScript engine using the 'best' driver (v8 in avalible). Its compiles `code` and allows for multiple dependency imports (like underscore)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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