Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bytes ¶
Bytes is an extension of the types.Bytes type which adds the ability to treat those values as results, so they can be passed as argument to Call* functions in tests. The content of the byte slice is copied to the WebAssembly module memory, starting at address zero in each invocation of Call* functions. This would be really unsafe to do in a production applicaiton, which is why the feature is only made available to unit tests.
func (Bytes) FormatValue ¶
func (Bytes) ValueTypes ¶
type Module ¶
type Module struct { api.Module // TODO: implement more features of the interface // contains filtered or unexported fields }
Module is an implementation of wazero's api.Module interface intended to be used as a stub in tests. The main feature is the ability to define a memory that the module will be exposing as its exported "memory".
func NewModule ¶
func NewModule(name string, opts ...ModuleOption) *Module
NewModule constructs a Module instance with the given name and configuration options.
type ModuleOption ¶
ModuleOption represents configuration options for the Module type.
func Memory ¶
func Memory(memory api.Memory) ModuleOption
Memory sets the memory of a Module instance.