Documentation
¶
Index ¶
- Variables
- type HeaderMap
- func (h HeaderMap) Add(key string, value string)
- func (h HeaderMap) ByteSize() uint64
- func (h HeaderMap) Clone() HeaderMap
- func (h HeaderMap) Del(key string)
- func (h HeaderMap) Get(key string) (value string, ok bool)
- func (h HeaderMap) Range(f func(key, value string) bool)
- func (h HeaderMap) Set(key string, value string)
- type Instance
- func (w *Instance) Acquire() bool
- func (w *Instance) GetByte(addr uint64) (byte, error)
- func (w *Instance) GetData() interface{}
- func (w *Instance) GetExportsFunc(funcName string) (*wasmer.Function, error)
- func (w *Instance) GetExportsMem(memName string) ([]byte, error)
- func (w *Instance) GetMemory(addr uint64, size uint64) ([]byte, error)
- func (w *Instance) GetModule() *Module
- func (w *Instance) GetUint32(addr uint64) (uint32, error)
- func (w *Instance) HandleError(err error)
- func (w *Instance) Lock(data interface{})
- func (w *Instance) Malloc(size int32) (uint64, error)
- func (w *Instance) PutByte(addr uint64, b byte) error
- func (w *Instance) PutMemory(addr uint64, size uint64, content []byte) error
- func (w *Instance) PutUint32(addr uint64, value uint32) error
- func (w *Instance) RegisterFunc(namespace string, funcName string, f interface{}) error
- func (w *Instance) Release()
- func (w *Instance) SetData(data interface{})
- func (w *Instance) Start() error
- func (w *Instance) Stop()
- func (w *Instance) Unlock()
- type InstanceOptions
- type IoBuffer
- type Module
- type VM
Constants ¶
This section is empty.
Variables ¶
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") ErrRegisterArgNum = errors.New("register func with invalid arg num") ErrRegisterArgType = errors.New("register func with invalid arg type") )
Functions ¶
This section is empty.
Types ¶
type HeaderMap ¶
HeaderMap is a simple implementation of HeaderMap.
func (HeaderMap) Add ¶
Add value for given key. Multiple headers with the same key may be added with this function. Use Set for setting a single header for the given key.
func (HeaderMap) Get ¶
Get value of key If multiple values associated with this key, first one will be returned.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func NewWasmerInstance ¶
func NewWasmerInstance(vm *VM, module *Module, options ...InstanceOptions) *Instance
func (*Instance) GetExportsFunc ¶
func (*Instance) HandleError ¶
func (*Instance) RegisterFunc ¶
type InstanceOptions ¶
type InstanceOptions func(instance *Instance)
type IoBuffer ¶
type IoBuffer struct {
// contains filtered or unexported fields
}
IoBuffer is a simple implementation of IoBuffer.
func NewIoBufferBytes ¶
func (*IoBuffer) Bytes ¶
Bytes returns all bytes from buffer, without draining any buffered data. It can be used to get fixed-length content, such as headers, body. Note: do not change content in return bytes, use write instead
func (*IoBuffer) Drain ¶
Drain drains a offset length of bytes in buffer. It can be used with Bytes(), after consuming a fixed-length of data
type Module ¶
type Module struct {
// contains filtered or unexported fields
}