wasm

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package wasm provides the WebAssembly-based plugin runner.

Package wasm provides the WebAssembly-based plugin runner using wazero.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostBindings

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

HostBindings implements the host function imports for wasm plugins.

func (*HostBindings) SetAPI

func (h *HostBindings) SetAPI(hostAPI plugin.HostAPI)

SetAPI sets the HostAPI for the bindings.

type WasmRunner

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

WasmRunner implements plugin.Runner using wazero for in-process wasm execution.

func NewWasmRunner

func NewWasmRunner(m *plugin.Manifest) (*WasmRunner, error)

NewWasmRunner creates a WasmRunner for the given plugin manifest.

func (*WasmRunner) Call

func (r *WasmRunner) Call(ctx context.Context, function string, params json.RawMessage) (json.RawMessage, error)

Call invokes a named wasm export with JSON parameters and returns JSON result.

func (*WasmRunner) Health

func (r *WasmRunner) Health(ctx context.Context) (*plugin.HealthStatus, error)

Health checks the plugin's is_ready export.

func (*WasmRunner) Load

Load compiles the wasm module, registers host functions, and creates the primary instance.

func (*WasmRunner) Start

func (r *WasmRunner) Start(ctx context.Context, config json.RawMessage) error

Start calls the wasm init() export with the plugin configuration.

func (*WasmRunner) Stop

func (r *WasmRunner) Stop(ctx context.Context) error

Stop drains in-flight calls and closes all wasm instances.

Jump to

Keyboard shortcuts

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