runtime

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WasmRuntime

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

WasmRuntime represents a WebAssembly runtime for executing WASM functions

func NewWasmRuntime

func NewWasmRuntime() (*WasmRuntime, error)

NewWasmRuntime creates a new WebAssembly runtime

func (*WasmRuntime) Close

func (r *WasmRuntime) Close() error

Close closes the WebAssembly runtime

func (*WasmRuntime) ExecuteFunction

func (r *WasmRuntime) ExecuteFunction(wasmFile string, functionName string, args ...any) (any, error)

ExecuteFunction calls a named export directly with primitive numeric arguments. Suitable for low-level WASM modules; prefer ExecuteWASI for application-level functions.

func (*WasmRuntime) ExecuteWASI added in v1.1.0

func (r *WasmRuntime) ExecuteWASI(wasmFile string, input map[string]any) (any, error)

ExecuteWASI runs a WASI command module using JSON-over-stdio for I/O. The module reads its input as a JSON object from stdin and must write its result as a JSON value to stdout before exiting with code 0.

Jump to

Keyboard shortcuts

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