wasm

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModuleConfig

func NewModuleConfig(m *InitMetadata) wazero.ModuleConfig

NewModuleConfig returns a new module config appropriate for the initialized metadata.

Types

type InitMetadata

type InitMetadata struct {
	// URL is how to load a `%.wasm` file that implements a command, usually
	// compiled to target WASI.
	//
	// If no scheme is present, this defaults to oci://, referencing an OCI
	// image. The wasm is identified be ENTRYPOINT and any other files in the
	// corresponding layers will be mounted read-only as the root file system.
	//
	// Other valid schemes are file:// for a local file or http[s]:// for one
	// retrieved via HTTP. In these cases, no filesystem will be mounted.
	URL string `mapstructure:"url"`

	// StrictSandbox when true uses fake sources to avoid vulnerabilities such
	// as timing attacks.
	//
	// # Affected configuration
	//
	//   - sys.Walltime increments with a constant value when read, initially a
	//     second resolution of the current system time.
	//   - sys.Nanotime increments with a constant value when read, initially
	//     zero.
	//   - sys.Nanosleep returns immediately.
	//   - Random number generators are seeded with a deterministic source.
	StrictSandbox bool `mapstructure:"strictSandbox"`

	// Guest is WebAssembly binary implementing the guest, loaded from URL.
	Guest []byte `mapstructure:"-"`

	// GuestName is module name of the guest, loaded from URL.
	GuestName string `mapstructure:"-"`
}

func GetInitMetadata

func GetInitMetadata(ctx context.Context, md metadata.Base) (*InitMetadata, error)

GetInitMetadata returns InitMetadata from the input metadata.

Jump to

Keyboard shortcuts

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