Versions in this module Expand all Collapse all v1 v1.1.0 Jun 6, 2023 Changes in this version + const PageSize + type Function struct + DebugName string + ExportNames []string + FunctionName string + GoModuleFunction api.GoModuleFunction + ParamNames []string + ParamTypes []api.ValueType + ResultNames []string + ResultTypes []api.ValueType + func NewFunction(fn any) *Function + func (f *Function) Call(ctx context.Context, params ...uint64) ([]uint64, error) + func (f *Function) CallWithStack(ctx context.Context, stack []uint64) error + func (f *Function) Definition() api.FunctionDefinition + type Global struct + ExportNames []string + Value uint64 + ValueType api.ValueType + func GlobalF32(value float32, export ...string) *Global + func GlobalF64(value float64, export ...string) *Global + func GlobalI32(value int32, export ...string) *Global + func GlobalI64(value int64, export ...string) *Global + func (g *Global) Get() uint64 + func (g *Global) String() string + func (g *Global) Type() api.ValueType + type Memory struct + Bytes []byte + Max uint32 + Min uint32 + func NewFixedMemory(size int) *Memory + func NewMemory(size int) *Memory + func (m *Memory) Definition() api.MemoryDefinition + func (m *Memory) Grow(deltaPages uint32) (previousPages uint32, ok bool) + func (m *Memory) Read(offset, length uint32) ([]byte, bool) + func (m *Memory) ReadByte(offset uint32) (byte, bool) + func (m *Memory) ReadFloat32Le(offset uint32) (float32, bool) + func (m *Memory) ReadFloat64Le(offset uint32) (float64, bool) + func (m *Memory) ReadUint16Le(offset uint32) (uint16, 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, value []byte) bool + func (m *Memory) WriteByte(offset uint32, value byte) bool + func (m *Memory) WriteFloat32Le(offset uint32, value float32) bool + func (m *Memory) WriteFloat64Le(offset uint32, value float64) bool + func (m *Memory) WriteString(offset uint32, value string) bool + func (m *Memory) WriteUint16Le(offset uint32, value uint16) bool + func (m *Memory) WriteUint32Le(offset uint32, value uint32) bool + func (m *Memory) WriteUint64Le(offset uint32, value uint64) bool + type Module struct + ExportMemory *Memory + Functions []*Function + Globals []*Global + ModuleName string + func NewModule(memory *Memory, functions ...*Function) *Module + func (m *Module) Close(ctx context.Context) error + func (m *Module) CloseWithExitCode(ctx context.Context, exitCode uint32) error + func (m *Module) ExitStatus() (exitCode uint32, exited bool) + func (m *Module) ExportedFunction(name string) api.Function + func (m *Module) ExportedFunctionDefinitions() map[string]api.FunctionDefinition + func (m *Module) ExportedGlobal(name string) api.Global + func (m *Module) ExportedMemory(name string) api.Memory + func (m *Module) ExportedMemoryDefinitions() map[string]api.MemoryDefinition + func (m *Module) Function(i int) api.Function + func (m *Module) Global(i int) api.Global + func (m *Module) Memory() api.Memory + func (m *Module) Name() string + func (m *Module) NumFunction() int + func (m *Module) NumGlobal() int + func (m *Module) String() string