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, and packages do not ship it. It lives beside the binary as skywire.wasm.gz with a manifest, skywire.wasm.json, both written by scripts/wasm-module.sh, and is fetched when the desk is first opened and refreshed after (pkg/visor/wasmmodule.go).
Package execwasm pkg/wasmhv/execwasm/serve.go c3-wasm-embed
Index ¶
Constants ¶
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 where the module is kept: beside the running binary, or in the user's cache directory when it is not there already and the binary's directory cannot be written, as for a packaged binary run by a user. It is "" when the executable cannot be located.
func ManifestPath ¶ added in v1.3.101
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.
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
ReadManifest reads the manifest beside the module at path.