wazero

package
v0.8.0-test1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArduinoInstantiate

func ArduinoInstantiate(ctx context.Context, rt wazero.Runtime) (api.Closer, error)

func AsExitError

func AsExitError(err error) (exitCode int, ok bool)

func ChromeInstantiate

func ChromeInstantiate(ctx context.Context, rt wazero.Runtime) (api.Closer, error)

func MvpInstantiate

func MvpInstantiate(ctx context.Context, rt wazero.Runtime) (api.Closer, error)

func RunWasm

func RunWasm(cfg *config.Config, wasmName string, wasmBytes []byte, wasmArgs ...string) (stdout, stderr []byte, err error)

单次执行 wasm

func WasiInstantiate

func WasiInstantiate(ctx context.Context, rt wazero.Runtime) (api.Closer, error)

Types

type Module

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

wasm 模块, 可多次执行

func BuildModule

func BuildModule(
	cfg *config.Config, wasmName string, wasmBytes []byte, wasmArgs ...string,
) (*Module, error)

构建模块(会执行编译)

func (*Module) Close

func (p *Module) Close() error

关闭模块

func (*Module) RunFunc

func (p *Module) RunFunc(name string, args ...uint64) (result []uint64, stdout, stderr []byte, err error)

执行指定函数(init会被强制执行一次)

func (*Module) RunMain

func (p *Module) RunMain() (stdout, stderr []byte, err error)

执行初始化, 仅执行一次

Jump to

Keyboard shortcuts

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