Documentation ¶
Index ¶
- Variables
- func NewVM(ctx context.Context, options ...VMOptions) api.WasmVM
- type Call
- 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) (api.WasmFunction, error)
- func (i *Instance) GetExportsMem(memName string) ([]byte, error)
- func (i *Instance) GetMemory(addr uint64, size uint64) ([]byte, error)
- func (i *Instance) GetModule() api.WasmModule
- func (i *Instance) GetUint32(addr uint64) (uint32, error)
- func (i *Instance) HandleError(err 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) RegisterFunc(namespace string, funcName string, f interface{}) 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 ModuleOptions
- type VM
- type VMOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAddrOverflow = errors.New("addr overflow") ErrInstanceNotStart = errors.New("instance has not started") ErrInstanceAlreadyStart = errors.New("instance has already started") ErrInvalidParam = errors.New("invalid param") ErrRegisterNotFunc = errors.New("register a non-func object") ErrRegisterArgType = errors.New("register func with invalid arg type") ErrPutUint32 = errors.New("could not put uint32 to memory") ErrGetUint32 = errors.New("could not get uint32 from memory") ErrPutByte = errors.New("could not put byte to memory") ErrGetByte = errors.New("could not get byte from memory") ErrPutData = errors.New("could not put data to memory") ErrGetData = errors.New("could not get data to memory") ErrGetExportsMemNotImplemented = errors.New("GetExportsMem not implemented") ErrMallocFunctionNotFound = errors.New("could not find memory allocate function") ErrMalloc = errors.New("could not allocate memory") ErrFuncNotExported = errors.New("function is not exported") )
Functions ¶
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func NewInstance ¶
func (*Instance) GetExportsFunc ¶
func (i *Instance) GetExportsFunc(funcName string) (api.WasmFunction, error)
func (*Instance) GetModule ¶
func (i *Instance) GetModule() api.WasmModule
func (*Instance) HandleError ¶
func (*Instance) RegisterFunc ¶
type InstanceOptions ¶
type InstanceOptions func(instance *Instance)
func InstanceWithLogger ¶
func InstanceWithLogger(logger logr.Logger) InstanceOptions
func InstanceWithMallocFunctionNames ¶
func InstanceWithMallocFunctionNames(names ...string) InstanceOptions
func InstanceWithStartFunctionNames ¶
func InstanceWithStartFunctionNames(names ...string) InstanceOptions
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) GetABINameList ¶
func (*Module) NewInstance ¶
func (m *Module) NewInstance() (api.WasmInstance, error)
type ModuleOptions ¶
type ModuleOptions func(module *Module)
func ModuleWithLogger ¶
func ModuleWithLogger(logger logr.Logger) ModuleOptions
Click to show internal directories.
Click to hide internal directories.