runtime

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WasmFunctionHandler

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

WasmFunctionHandler implements the FunctionHandler interface for WebAssembly functions

func NewWasmFunctionHandler

func NewWasmFunctionHandler(wasmFile, functionName string) (*WasmFunctionHandler, error)

NewWasmFunctionHandler creates a new WebAssembly function handler

func (*WasmFunctionHandler) Close

func (h *WasmFunctionHandler) Close() error

Close closes the WebAssembly function handler

func (*WasmFunctionHandler) Execute

func (h *WasmFunctionHandler) Execute(input map[string]any) (any, error)

Execute executes the WebAssembly function

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 executes a WebAssembly function

Jump to

Keyboard shortcuts

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