wasi

package
v0.20.21 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error added in v0.11.2

func Error(ctx context.Context, module api.Module, ptr wasm.Ptr, state wasm.State, err string) wasm.Buffer

func Execute

func Execute(ctx context.Context, params ExecParams) (output []byte, err error)

func LoadBytes added in v0.11.2

func LoadBytes(module api.Module, value wasm.Buffer) []byte

func LoadString added in v0.11.2

func LoadString(module api.Module, value wasm.String) string

func Malloc added in v0.11.2

func Malloc(ctx context.Context, module api.Module, data []byte) wasm.Buffer

func MallocJSON added in v0.17.0

func MallocJSON(ctx context.Context, module api.Module, ref wasm.Ptr, value any) wasm.Buffer

Types

type CompileParams added in v0.1.3

type CompileParams struct {
	Wasm            []byte
	CacheDir        string
	MaxMemoryMib    uint32
	HostFunctionMap map[string]any
}

type ExecParams

type ExecParams struct {
	Module  *Module
	BinName string
	Stdin   io.Reader
	Stderr  io.Writer
	Args    []string
	Timeout time.Duration
	Env     map[string]string

	CompileParams
}

type Module added in v0.6.7

type Module struct {
	wazero.CompiledModule
	wazero.Runtime
	// contains filtered or unexported fields
}

func Compile added in v0.1.3

func Compile(ctx context.Context, params CompileParams) (Module, error)

func (Module) Checksum added in v0.18.0

func (mod Module) Checksum() string

func (Module) Close added in v0.6.7

func (mod Module) Close(ctx context.Context) error

func (Module) Instantiate added in v0.6.7

func (mod Module) Instantiate(ctx context.Context, cfg wazero.ModuleConfig) error

func (Module) MaxMemoryMib added in v0.17.0

func (mod Module) MaxMemoryMib() uint32

func (Module) SHA256Checksum added in v0.20.5

func (mod Module) SHA256Checksum() string

type RuntimeError added in v0.19.8

type RuntimeError struct {
	Message string
	// contains filtered or unexported fields
}

func (RuntimeError) Error added in v0.19.8

func (err RuntimeError) Error() string

func (RuntimeError) ExitCode added in v0.19.8

func (err RuntimeError) ExitCode() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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