Documentation
¶
Overview ¶
Package native runs kernel guests on wazero.
Index ¶
- type Function
- type Global
- type Instance
- type Memory
- func (m *Memory) Grow(pages uint32) (uint32, bool)
- func (m *Memory) Read(offset, length uint32) ([]byte, bool)
- func (m *Memory) ReadByteAt(offset uint32) (byte, bool)
- func (m *Memory) ReadUint32Le(offset uint32) (uint32, bool)
- func (m *Memory) ReadUint64Le(offset uint32) (uint64, bool)
- func (m *Memory) Size() uint32
- func (m *Memory) Write(offset uint32, data []byte) bool
- func (m *Memory) WriteByteAt(offset uint32, val byte) bool
- func (m *Memory) WriteUint32Le(offset uint32, val uint32) bool
- func (m *Memory) WriteUint64Le(offset uint32, val uint64) bool
- type Module
- type Runtime
- func (r *Runtime) Close(ctx context.Context) error
- func (r *Runtime) Compile(ctx context.Context, wasm []byte) (engine.Module, error)
- func (r *Runtime) Define(ctx context.Context, module string, fns map[string]engine.HostFunction) error
- func (r *Runtime) Snapshotter(ctx context.Context) engine.Snapshotter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function is an exported wazero guest function.
type Global ¶
type Global struct {
// contains filtered or unexported fields
}
Global is an exported wazero guest global.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is a running wazero guest and its active guest calls. Only the goroutine running the guest uses it.
func (*Instance) ExportedFunction ¶
ExportedFunction returns an exported function, or nil when the guest does not export it.
func (*Instance) ExportedGlobal ¶
ExportedGlobal returns an exported global, or nil when the guest does not export it.
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is the linear memory of a wazero guest.
func (*Memory) ReadByteAt ¶
ReadByteAt returns the byte at offset.
func (*Memory) ReadUint32Le ¶
ReadUint32Le returns the little-endian uint32 at offset.
func (*Memory) ReadUint64Le ¶
ReadUint64Le returns the little-endian uint64 at offset.
func (*Memory) WriteByteAt ¶
WriteByteAt writes one byte at offset.
func (*Memory) WriteUint32Le ¶
WriteUint32Le writes a little-endian uint32 at offset.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is a compiled wazero module.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is a wazero runtime with threads enabled. Canceling the context of a running guest stops it, even while it computes.
func (*Runtime) Define ¶
func (r *Runtime) Define(ctx context.Context, module string, fns map[string]engine.HostFunction) error
Define provides fns to guests as the imports of module.
func (*Runtime) Snapshotter ¶
func (r *Runtime) Snapshotter(ctx context.Context) engine.Snapshotter
Snapshotter returns the snapshotter of the host call running under ctx, or nil when its guest is not transformed with Asyncify.