Documentation
¶
Overview ¶
Package wasm provides WebAssembly runtime infrastructure for Reglet plugins. It manages plugin loading, execution, and capability-based sandboxing using wazero.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseGlobalCache ¶
CloseGlobalCache releases resources held by the global compilation cache. This is only needed for long-running processes (servers, workers) that require graceful shutdown. CLI tools can skip this - the OS handles cleanup on exit.
Types ¶
type Config ¶
type Config struct {
Values map[string]interface{}
}
Config represents plugin configuration Maps to the WIT config record
type ConfigSchema ¶
ConfigSchema represents the JSON Schema for plugin configuration Maps to the WIT config-schema record
type Evidence ¶
Evidence is re-exported from domain for backward compatibility in this package. Use execution.Evidence from domain layer.
type FieldDef ¶
FieldDef represents a configuration field definition Maps to the WIT field-def record
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin manages the lifecycle and execution of a compiled WASM module.
func (*Plugin) Close ¶
Close performs any necessary cleanup. Currently a no-op as instances are ephemeral.
func (*Plugin) Describe ¶
func (p *Plugin) Describe(ctx context.Context) (*PluginInfo, error)
Describe executes the plugin's 'describe' function to retrieve metadata.
type PluginError ¶
type PluginError = execution.PluginError
PluginError is re-exported from domain for backward compatibility in this package. Use execution.PluginError from domain layer.
type PluginInfo ¶
type PluginInfo struct {
Name string
Version string
Description string
Capabilities []capabilities.Capability
}
PluginInfo contains metadata about a plugin Maps to the WIT plugin-info record
type PluginObservationResult ¶
type PluginObservationResult struct {
Evidence *execution.Evidence
Error *execution.PluginError
}
PluginObservationResult is the result of running an observation through a WASM plugin. This is a low-level boundary type.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime manages WASM execution.
func NewRuntime ¶
NewRuntime creates a runtime with no capabilities and no redaction.
func NewRuntimeWithCapabilities ¶
func NewRuntimeWithCapabilities( ctx context.Context, version build.Info, caps map[string][]capabilities.Capability, redactor *sensitivedata.Redactor, memoryLimitMB int, ) (*Runtime, error)
NewRuntimeWithCapabilities initializes runtime with permissions and optional output redaction.
func (*Runtime) GetPluginSchema ¶
GetPluginSchema implements config.PluginSchemaProvider. It loads the plugin (if not already loaded) and retrieves its JSON Schema.