wasm

package
v0.0.0-...-a0bdcac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMemory

func ReadMemory(_ context.Context, mem wapi.Memory, offset uint32, size uint32) ([]byte, error)

func WriteMemory

func WriteMemory(ctx context.Context, m wapi.Module, data []byte) (uint64, error)

Types

type Function

type Function struct {
	// contains filtered or unexported fields
}

func (*Function) Invoke

func (f *Function) Invoke(ctx context.Context, data []byte) ([]byte, error)

Invoke invoke a function. TODO: this is likely be highly inefficient as the model is TODO: loaded for each invocation but at this stage I don't TODO: have enough knowledge of memory management to make TODO: things better.

type Options

type Options struct {
	Stdout io.Writer
	Stderr io.Writer
	FS     fs.FS
}

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(ctx context.Context, opt Options) (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close(ctx context.Context) error

func (*Runtime) Export

func (r *Runtime) Export(ctx context.Context, name string, fn interface{}) error

func (*Runtime) Load

func (r *Runtime) Load(ctx context.Context, name string, reader io.Reader) (*Function, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL