Versions in this module Expand all Collapse all v9 v9.0.0 Jun 27, 2023 Changes in this version + var ErrAddrOverflow = errors.New("addr overflow") + var ErrFuncNotExported = errors.New("function is not exported") + var ErrGetByte = errors.New("could not get byte from memory") + var ErrGetData = errors.New("could not get data to memory") + var ErrGetExportsMemNotImplemented = errors.New("GetExportsMem not implemented") + var ErrGetUint32 = errors.New("could not get uint32 from memory") + var ErrInstanceAlreadyStart = errors.New("instance has already started") + var ErrInstanceNotStart = errors.New("instance has not started") + var ErrInvalidParam = errors.New("invalid param") + var ErrMalloc = errors.New("could not allocate memory") + var ErrMallocFunctionNotFound = errors.New("could not find memory allocate function") + var ErrPutByte = errors.New("could not put byte to memory") + var ErrPutData = errors.New("could not put data to memory") + var ErrPutUint32 = errors.New("could not put uint32 to memory") + var ErrRegisterArgType = errors.New("register func with invalid arg type") + var ErrRegisterNotFunc = errors.New("register a non-func object") + func NewVM(ctx context.Context, options ...VMOptions) api.WasmVM + type Call struct + func (c *Call) Call(args ...interface{}) (interface{}, error) + type Instance struct + func NewInstance(ctx context.Context, vm *VM, module *Module, options ...InstanceOptions) *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 func(instance *Instance) + func InstanceWithLogger(logger logr.Logger) InstanceOptions + func InstanceWithMallocFunctionNames(names ...string) InstanceOptions + func InstanceWithStartFunctionNames(names ...string) InstanceOptions + type Module struct + func NewModule(ctx context.Context, vm *VM, module *wasmtime.Module, wasmBytes []byte, ...) *Module + func (m *Module) GetABINameList() []string + func (m *Module) Init() + func (m *Module) NewInstance() (api.WasmInstance, error) + type ModuleOptions func(module *Module) + func ModuleWithLogger(logger logr.Logger) ModuleOptions + type VM struct + func (w *VM) Close() (err error) + func (w *VM) Init() + func (w *VM) Name() string + func (w *VM) NewModule(wasmBytes []byte) (api.WasmModule, error) + type VMOptions func(vm *VM) + func VMWithLogger(logger logr.Logger) VMOptions Other modules containing this package github.com/banzaicloud/proxy-wasm-go-host/runtime/wasmtime github.com/banzaicloud/proxy-wasm-go-host/runtime/wasmtime/v3