Documentation
¶
Overview ¶
Package wasm binds the wazero runtime to the Ext plugin engine.
Index ¶
- Constants
- func Profile() plugin.BackendProfile
- func ReactorProfile() plugin.BackendProfile
- func RunCommand(ctx context.Context, module []byte, opts CommandOptions) (int, error)
- type Backend
- type CommandOptions
- type CompilationCache
- type Inspection
- type Options
- type ReactorBackend
- type ReactorOptions
- type Target
Constants ¶
const ( TargetNone = webwasm.TargetNone TargetWASI = webwasm.TargetWASI TargetHost = webwasm.TargetHost TargetComponent = webwasm.TargetComponent )
const DefaultMemoryPages = webwasm.DefaultMemoryPages
const MaxModuleBytes = webwasm.MaxModuleBytes
Variables ¶
This section is empty.
Functions ¶
func Profile ¶
func Profile() plugin.BackendProfile
func ReactorProfile ¶
func ReactorProfile() plugin.BackendProfile
func RunCommand ¶
Types ¶
type Backend ¶
func Open ¶
Open starts a persistent WASI command and binds its raw byte stream to the ext.io.pc/v1 JSON-line transport. A guest SDK compiles its reactor exports into every wasm32 module, so a WASI command may import ext_plugin.reverse without ever calling it: Open provides the reactor ABI's stubs unless opts names its own.
type CommandOptions ¶
type CommandOptions = webwasm.CommandOptions
type CompilationCache ¶ added in v0.5.0
type CompilationCache = runtime.CompilationCache
CompilationCache keeps compiled modules, so opening the same module again skips compilation: set it in Options.CompilationCache. Share one among the sessions of a process and Close it after they have closed.
func NewCompilationCache ¶ added in v0.5.0
func NewCompilationCache() *CompilationCache
NewCompilationCache returns an empty cache that lives in memory.
type Inspection ¶
type Inspection = webwasm.Inspection
type ReactorBackend ¶
type ReactorBackend struct {
// contains filtered or unexported fields
}
func OpenReactor ¶
func OpenReactor(ctx context.Context, module []byte, opts ReactorOptions) (*ReactorBackend, error)
func (*ReactorBackend) Close ¶
func (b *ReactorBackend) Close() error
func (*ReactorBackend) Handshake ¶
func (b *ReactorBackend) Handshake(ctx context.Context) (plugin.Descriptor, error)
func (*ReactorBackend) WaitClosed ¶
func (b *ReactorBackend) WaitClosed(ctx context.Context) error
type ReactorOptions ¶
type ReactorOptions = webwasm.ReactorOptions
Directories
¶
| Path | Synopsis |
|---|---|
|
Package runtime implements the src/ctx/web WebAssembly host contract with wazero.
|
Package runtime implements the src/ctx/web WebAssembly host contract with wazero. |
|
cmd/wasirun
command
wasirun checks a portable C guest core compiled to WASI Preview 1.
|
wasirun checks a portable C guest core compiled to WASI Preview 1. |