Versions in this module Expand all Collapse all v0 v0.2.0 Feb 21, 2023 Changes in this version + type CompiledModule struct + HostModule HostModule[T] + type HostModule interface + Functions func() Functions[T] + Instantiate func(...Option[T]) T + Name func() string v0.1.0 Feb 21, 2023 Changes in this version + const PageSize + var ErrNoRuntime = errors.New("compilation context contains no wazero runtime") + func Build(runtime wazero.Runtime, plugin Plugin[T], decorators ...Decorator[T]) wazero.HostModuleBuilder + func Configure(value T, options ...Option[T]) + func Instantiate(ctx *InstantiationContext, compiled *CompiledPlugin[T], opts ...Option[T]) (api.Module, error) + func NewCallContext(ctx context.Context, ins *InstantiationContext) context.Context + func Read(memory api.Memory, offset, length uint32) []byte + func WithCallContext(ctx context.Context, plugin Plugin[T], opts ...Option[T]) (context.Context, func()) + type Array []T + func (arg Array[T]) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Array[T]) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Array[T]) LoadObject(memory api.Memory, object []byte) Array[T] + func (arg Array[T]) LoadValue(memory api.Memory, stack []uint64) Array[T] + func (arg Array[T]) ObjectSize() int + func (arg Array[T]) StoreObject(memory api.Memory, object []byte) + func (arg Array[T]) ValueTypes() []api.ValueType + type Bytes Array[byte] + func (arg Bytes) Format(w io.Writer) + func (arg Bytes) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Bytes) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Bytes) LoadObject(memory api.Memory, object []byte) Bytes + func (arg Bytes) LoadValue(memory api.Memory, stack []uint64) Bytes + func (arg Bytes) ObjectSize() int + func (arg Bytes) StoreObject(memory api.Memory, object []byte) + func (arg Bytes) ValueTypes() []api.ValueType + type CompilationContext struct + func NewCompilationContext(ctx context.Context, rt wazero.Runtime) *CompilationContext + func (ctx *CompilationContext) Close(context.Context) error + type CompiledPlugin struct + Plugin Plugin[T] + func Compile(ctx *CompilationContext, plugin Plugin[T], decorators ...Decorator[T]) (*CompiledPlugin[T], error) + type Decorator interface + Decorate func(module string, fn Function[T]) Function[T] + func DecoratorFunc(d func(string, Function[T]) Function[T]) Decorator[T] + func Log(logger *log.Logger) Decorator[T] + type Errno int32 + func (err Errno) Errno() int32 + func (err Errno) Error() string + type Error = Optional[None] + func Fail(err error) Error + type Float32 float32 + func (arg Float32) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Float32) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Float32) LoadObject(memory api.Memory, object []byte) Float32 + func (arg Float32) LoadValue(memory api.Memory, stack []uint64) Float32 + func (arg Float32) ObjectSize() int + func (arg Float32) StoreObject(memory api.Memory, object []byte) + func (arg Float32) StoreValue(memory api.Memory, stack []uint64) + func (arg Float32) ValueTypes() []api.ValueType + type Float64 float64 + func (arg Float64) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Float64) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Float64) LoadObject(memory api.Memory, object []byte) Float64 + func (arg Float64) LoadValue(memory api.Memory, stack []uint64) Float64 + func (arg Float64) ObjectSize() int + func (arg Float64) StoreObject(memory api.Memory, object []byte) + func (arg Float64) StoreValue(memory api.Memory, stack []uint64) + func (arg Float64) ValueTypes() []api.ValueType + type Function struct + Func func(T, context.Context, api.Module, []uint64) + Name string + Params []Value + Results []Value + func F0(fn func(T, context.Context) R) Function[T] + func F1(fn func(T, context.Context, P) R) Function[T] + func F2(fn func(T, context.Context, P1, P2) R) Function[T] + func F3(fn func(T, context.Context, P1, P2, P3) R) Function[T] + func F4(fn func(T, context.Context, P1, P2, P3, P4) R) Function[T] + func F5(fn func(T, context.Context, P1, P2, P3, P4, P5) R) Function[T] + func F6(fn func(T, context.Context, P1, P2, P3, P4, P5, P6) R) Function[T] + func F7(fn func(T, context.Context, P1, P2, P3, P4, P5, P6, P7) R) Function[T] + func F8(fn func(T, context.Context, P1, P2, P3, P4, P5, P6, P7, P8) R) Function[T] + type Functions map[string]Function[T] + type InstantiationContext struct + func NewInstantiationContext(ctx context.Context, rt wazero.Runtime) *InstantiationContext + func (ins *InstantiationContext) Close(ctx context.Context) error + type Int16 int16 + func (arg Int16) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Int16) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Int16) LoadObject(memory api.Memory, object []byte) Int16 + func (arg Int16) LoadValue(memory api.Memory, stack []uint64) Int16 + func (arg Int16) ObjectSize() int + func (arg Int16) StoreObject(memory api.Memory, object []byte) + func (arg Int16) StoreValue(memory api.Memory, stack []uint64) + func (arg Int16) ValueTypes() []api.ValueType + type Int32 int32 + func (arg Int32) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Int32) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Int32) LoadObject(memory api.Memory, object []byte) Int32 + func (arg Int32) LoadValue(memory api.Memory, stack []uint64) Int32 + func (arg Int32) ObjectSize() int + func (arg Int32) StoreObject(memory api.Memory, object []byte) + func (arg Int32) StoreValue(memory api.Memory, stack []uint64) + func (arg Int32) ValueTypes() []api.ValueType + type Int64 int64 + func (arg Int64) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Int64) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Int64) LoadObject(memory api.Memory, object []byte) Int64 + func (arg Int64) LoadValue(memory api.Memory, stack []uint64) Int64 + func (arg Int64) ObjectSize() int + func (arg Int64) StoreObject(memory api.Memory, object []byte) + func (arg Int64) StoreValue(memory api.Memory, stack []uint64) + func (arg Int64) ValueTypes() []api.ValueType + type Int8 int8 + func (arg Int8) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Int8) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Int8) LoadObject(memory api.Memory, object []byte) Int8 + func (arg Int8) LoadValue(memory api.Memory, stack []uint64) Int8 + func (arg Int8) ObjectSize() int + func (arg Int8) StoreObject(memory api.Memory, object []byte) + func (arg Int8) StoreValue(memory api.Memory, stack []uint64) + func (arg Int8) ValueTypes() []api.ValueType + type List struct + func (arg List[T]) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg List[T]) Index(index int) T + func (arg List[T]) Len() int + func (arg List[T]) LoadValue(memory api.Memory, stack []uint64) List[T] + func (arg List[T]) Range(fn func(int, T) bool) + func (arg List[T]) ValueTypes() []api.ValueType + type Memory []byte + func NewFixedSizeMemory(size uint32) Memory + func (mem Memory) Definition() api.MemoryDefinition + func (mem Memory) Grow(uint32) (uint32, bool) + func (mem Memory) Read(offset, length uint32) ([]byte, bool) + func (mem Memory) ReadByte(offset uint32) (byte, bool) + func (mem Memory) ReadFloat32Le(offset uint32) (float32, bool) + func (mem Memory) ReadFloat64Le(offset uint32) (float64, bool) + func (mem Memory) ReadUint16Le(offset uint32) (uint16, bool) + func (mem Memory) ReadUint32Le(offset uint32) (uint32, bool) + func (mem Memory) ReadUint64Le(offset uint32) (uint64, bool) + func (mem Memory) Size() uint32 + func (mem Memory) Write(offset uint32, value []byte) bool + func (mem Memory) WriteByte(offset uint32, value byte) bool + func (mem Memory) WriteFloat32Le(offset uint32, value float32) bool + func (mem Memory) WriteFloat64Le(offset uint32, value float64) bool + func (mem Memory) WriteString(offset uint32, value string) bool + func (mem Memory) WriteUint16Le(offset uint32, value uint16) bool + func (mem Memory) WriteUint32Le(offset uint32, value uint32) bool + func (mem Memory) WriteUint64Le(offset uint32, value uint64) bool + type Module interface + type None struct + func (None) FormatObject(w io.Writer, _ api.Memory, _ []byte) + func (None) FormatValue(w io.Writer, _ api.Memory, _ []uint64) + func (None) LoadObject(api.Memory, []byte) (none None) + func (None) LoadValue(api.Memory, []uint64) (none None) + func (None) ObjectSize() int + func (None) StoreObject(api.Memory, []byte) + func (None) StoreValue(api.Memory, []uint64) + func (None) ValueTypes() []api.ValueType + type Object interface + FormatObject func(w io.Writer, memory api.Memory, object []byte) + LoadObject func(memory api.Memory, object []byte) T + ObjectSize func() int + StoreObject func(memory api.Memory, object []byte) + type Option interface + Configure func(T) + func OptionFunc(opt func(T)) Option[T] + type Optional struct + var OK Optional[None] + func Err(err error) Optional[T] + func Opt(res T, err error) Optional[T] + func Res(res T) Optional[T] + func (opt Optional[T]) Error() error + func (opt Optional[T]) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (opt Optional[T]) LoadValue(memory api.Memory, stack []uint64) Optional[T] + func (opt Optional[T]) Result() T + func (opt Optional[T]) StoreValue(memory api.Memory, stack []uint64) + func (opt Optional[T]) ValueTypes() []api.ValueType + type Param interface + LoadValue func(memory api.Memory, stack []uint64) T + type ParamResult interface + type Plugin interface + Functions func() Functions[T] + Instantiate func(...Option[T]) T + Name func() string + type Pointer struct + func New() Pointer[T] + func Ptr(memory api.Memory, offset uint32) Pointer[T] + func (arg Pointer[T]) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Pointer[T]) Index(index int) Pointer[T] + func (arg Pointer[T]) Load() (value T) + func (arg Pointer[T]) LoadValue(memory api.Memory, stack []uint64) Pointer[T] + func (arg Pointer[T]) Memory() api.Memory + func (arg Pointer[T]) Object() []byte + func (arg Pointer[T]) Offset() uint32 + func (arg Pointer[T]) Store(value T) + func (arg Pointer[T]) ValueTypes() []api.ValueType + type Result interface + StoreValue func(memory api.Memory, stack []uint64) + type SEGFAULT struct + Length uint32 + Offset uint32 + func (err SEGFAULT) Error() string + type String string + func (arg String) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg String) LoadValue(memory api.Memory, stack []uint64) String + func (arg String) ValueTypes() []api.ValueType + type Uint16 uint16 + func (arg Uint16) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Uint16) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Uint16) LoadObject(memory api.Memory, object []byte) Uint16 + func (arg Uint16) LoadValue(memory api.Memory, stack []uint64) Uint16 + func (arg Uint16) ObjectSize() int + func (arg Uint16) StoreObject(memory api.Memory, object []byte) + func (arg Uint16) StoreValue(memory api.Memory, stack []uint64) + func (arg Uint16) ValueTypes() []api.ValueType + type Uint32 uint32 + func (arg Uint32) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Uint32) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Uint32) LoadObject(memory api.Memory, object []byte) Uint32 + func (arg Uint32) LoadValue(memory api.Memory, stack []uint64) Uint32 + func (arg Uint32) ObjectSize() int + func (arg Uint32) StoreObject(memory api.Memory, object []byte) + func (arg Uint32) StoreValue(memory api.Memory, stack []uint64) + func (arg Uint32) ValueTypes() []api.ValueType + type Uint64 uint64 + func (arg Uint64) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Uint64) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Uint64) LoadObject(memory api.Memory, object []byte) Uint64 + func (arg Uint64) LoadValue(memory api.Memory, stack []uint64) Uint64 + func (arg Uint64) ObjectSize() int + func (arg Uint64) StoreObject(memory api.Memory, object []byte) + func (arg Uint64) StoreValue(memory api.Memory, stack []uint64) + func (arg Uint64) ValueTypes() []api.ValueType + type Uint8 uint8 + func (arg Uint8) FormatObject(w io.Writer, memory api.Memory, object []byte) + func (arg Uint8) FormatValue(w io.Writer, memory api.Memory, stack []uint64) + func (arg Uint8) LoadObject(memory api.Memory, object []byte) Uint8 + func (arg Uint8) LoadValue(memory api.Memory, stack []uint64) Uint8 + func (arg Uint8) ObjectSize() int + func (arg Uint8) StoreObject(memory api.Memory, object []byte) + func (arg Uint8) StoreValue(memory api.Memory, stack []uint64) + func (arg Uint8) ValueTypes() []api.ValueType + type Value interface + FormatValue func(w io.Writer, memory api.Memory, stack []uint64) + ValueTypes func() []api.ValueType