wasm

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

CoreFeatures are the WebAssembly Core specification features our embedded binaries are compiled with.

Variables

This section is empty.

Functions

func NewRuntime added in v0.4.1

func NewRuntime(ctx context.Context, cfg wazero.RuntimeConfig) (wazero.Runtime, error)

NewRuntime returns a new WebAssembly wazero.Runtime compatible with go-ffmpreg.

func Run added in v0.3.0

func Run(
	ctx context.Context,
	runtime wazero.Runtime,
	module wazero.CompiledModule,
	args Args,
) (rc uint32, err error)

Run will run given compiled WebAssembly module within the given runtime, with given arguments. Returns the exit code, or error.

Types

type Args

type Args struct {

	// Program name, depending on the
	// module being run this may or may
	// not be necessary.
	Name string

	// Optional further module configuration function.
	// (e.g. to mount filesystem dir, set env vars, etc).
	Config func(wazero.ModuleConfig) wazero.ModuleConfig

	// Standard FDs.
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer

	// CLI args.
	Args []string
}

Args encompasses a common set of configuration options often passed to wazero.Runtime on module instantiation.

Jump to

Keyboard shortcuts

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