Documentation
¶
Overview ¶
Package host provides the runtime environment for executing Reglet WASM plugins.
It abstracts the underlying WASM engine (wazero), manages plugin lifecycle, and handles the low-level ABI interactions (memory allocation, data packing/unpacking). This package also facilitates the registration of host functions, enabling plugins to securely access system capabilities exposed by the host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor manages the lifecycle of a WASM plugin.
func NewExecutor ¶
NewExecutor creates a new executor with the given options.
func (*Executor) LoadPlugin ¶
LoadPlugin instantiates a WASM module.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader orchestrates the manifest loading pipeline.
func NewLoader ¶
func NewLoader(opts ...LoaderOption) *Loader
NewLoader creates a new Loader with defaults.
type LoaderOption ¶
type LoaderOption func(*loaderConfig)
LoaderOption configures the Loader.
func WithParser ¶
func WithParser(p ports.ManifestParser) LoaderOption
WithParser sets a custom manifest parser.
func WithRegistry ¶
func WithRegistry(r ports.CapabilityRegistry) LoaderOption
WithRegistry configures the loader with a capability registry for validation.
func WithStrictTemplates ¶
func WithStrictTemplates(enabled bool) LoaderOption
WithStrictTemplates enables/disables strict template mode. When enabled (default), template rendering fails if a referenced key is missing. Disable only for development or when missing keys should become empty strings.
func WithTemplateEngine ¶
func WithTemplateEngine(t ports.TemplateEngine) LoaderOption
WithTemplateEngine sets a template engine.
type Option ¶
type Option func(*Executor)
Option defines a functional option for configuring the Executor.
func WithHostFunctions ¶
func WithHostFunctions(registry *hostfuncs.HandlerRegistry) Option
WithHostFunctions configures the executor with a host function registry.
type PluginInstance ¶
type PluginInstance struct {
// contains filtered or unexported fields
}
PluginInstance represents an instantiated WASM plugin.