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
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.
Click to show internal directories.
Click to hide internal directories.