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 ¶
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
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.