Documentation ¶
Index ¶
- Variables
- func NewVM() common.WasmVM
- type Instance
- func (i *Instance) Acquire() bool
- func (i *Instance) GetByte(addr uint64) (byte, error)
- func (i *Instance) GetData() interface{}
- func (i *Instance) GetExportsFunc(funcName string) (common.WasmFunction, error)
- func (i *Instance) GetExportsMem(memName string) ([]byte, error)
- func (i *Instance) GetMemory(addr uint64, size uint64) ([]byte, error)
- func (i *Instance) GetModule() common.WasmModule
- func (i *Instance) GetUint32(addr uint64) (uint32, error)
- func (i *Instance) HandleError(error)
- func (i *Instance) Lock(data interface{})
- func (i *Instance) Malloc(size int32) (uint64, error)
- func (i *Instance) PutByte(addr uint64, b byte) error
- func (i *Instance) PutMemory(addr uint64, size uint64, content []byte) error
- func (i *Instance) PutUint32(addr uint64, value uint32) error
- func (i *Instance) RegisterImports(abiName string) error
- func (i *Instance) Release()
- func (i *Instance) SetData(data interface{})
- func (i *Instance) Start() error
- func (i *Instance) Stop()
- func (i *Instance) Unlock()
- type InstanceOptions
- type Module
- type VM
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInstanceNotStart = errors.New("instance has not started") ErrInstanceAlreadyStart = errors.New("instance has already started") )
Functions ¶
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func NewInstance ¶
func NewInstance(vm *VM, module *Module, options ...InstanceOptions) *Instance
func (*Instance) GetExportsFunc ¶
func (i *Instance) GetExportsFunc(funcName string) (common.WasmFunction, error)
func (*Instance) GetModule ¶
func (i *Instance) GetModule() common.WasmModule
func (*Instance) HandleError ¶
func (*Instance) RegisterImports ¶
type InstanceOptions ¶
type InstanceOptions func(instance *Instance)
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) GetABINameList ¶
func (*Module) Init ¶
func (w *Module) Init()
Init reads the exported functions to support later calls to GetABINameList.
func (*Module) NewInstance ¶
func (w *Module) NewInstance() common.WasmInstance
Click to show internal directories.
Click to hide internal directories.