goja_runtime

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterVMSetupFunc added in v0.1.3

func AfterVMSetupFunc(afterVmSetup func(ctx context.Context, vm *goja.Runtime))

AfterVMSetupFunc allows to set a function that will be called after the VM is setup.

Types

type GojaRunnerV1

type GojaRunnerV1 struct {
	// contains filtered or unexported fields
}

type JsContext

type JsContext interface {
	GetValue(key string) interface{}
	SetValue(key string, value interface{})
}

type NativeModule

type NativeModule struct {
	// contains filtered or unexported fields
}

NativeModule represents a native module that can be registered and used in the runtime.

func RegisterNativeAPI

func RegisterNativeAPI(name string) *NativeModule

RegisterNativeAPI registers a new native API which could be bound to and used at run-time.

func (*NativeModule) RegisterNativeAPI

func (module *NativeModule) RegisterNativeAPI(name string) *NativeModule

RegisterNativeAPI registers a new native API which could be bound to and used at run-time.

func (*NativeModule) RegisterNativeFunction

func (module *NativeModule) RegisterNativeFunction(name string, fn func(ctx context.Context, binding runtimesRegistry.BindingSettings, jsContext JsContext, args ...interface{}) (interface{}, error))

RegisterNativeFunction registers a new native function which could be bound to and used at run-time.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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