Help us shape the future of Go! Take the 2026 Go Developer Survey

execwasm

package
v1.3.101 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package execwasm pkg/wasmhv/execwasm/execwasm.go c3-wasm-embed

The full skywire command module for GOOS=js: the desk's `skywire` command and the tab visor. It is not embedded in the native binary. It ships beside it as skywire.wasm.gz with a manifest, skywire.wasm.json, both written by scripts/wasm-module.sh, and a visor serves that copy at /skywire.wasm and refreshes it when the desk is opened (pkg/visor/wasmmodule.go).

Package execwasm pkg/wasmhv/execwasm/serve.go c3-wasm-embed

Index

Constants

View Source
const (
	ModuleName   = "skywire.wasm.gz"
	ManifestName = "skywire.wasm.json"
)

The module and its manifest, as installed beside the binary.

Variables

This section is empty.

Functions

func DefaultPath added in v1.3.101

func DefaultPath() string

DefaultPath is the module installed beside the running binary, "" when the executable cannot be located.

func ManifestPath added in v1.3.101

func ManifestPath(path string) string

ManifestPath is the manifest beside the module at path.

func Serve

func Serve(w http.ResponseWriter, r *http.Request, path string)

Serve answers a GET for the module at path. A gzipped module goes out as is with Content-Encoding: gzip when the client accepts it and is inflated on the fly otherwise, so it is never held in memory; any other file is served as it is. Its Stamp is the ETag. Content-Type and Cache-Control are the caller's to set.

func Stamp

func Stamp(path string) string

Stamp fingerprints the module at path for ETags and the desk's served version: the manifest's sha256 when it has one, else the file's size and mtime, so a module rebuilt in place by a developer still changes it. It is "" when there is no module.

Types

type Manifest added in v1.3.101

type Manifest struct {
	Version  string `json:"version"`
	Revision string `json:"revision"`
	SHA256   string `json:"sha256"`
	Size     int64  `json:"size"`
}

Manifest describes one build of the module.

func ReadManifest added in v1.3.101

func ReadManifest(path string) (Manifest, error)

ReadManifest reads the manifest beside the module at path.

Jump to

Keyboard shortcuts

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