Documentation ¶
Index ¶
- Constants
- Variables
- func Build(c *config.Config) error
- func MakeAppJS(c *config.Config) ([]byte, error)
- func MakeAppWorkerJS(c *config.Config) ([]byte, error)
- func MakeFiles(c *config.Config) error
- func MakeIndexHTML(c *config.Config) ([]byte, error)
- func MakeManifestJSON(c *config.Config) ([]byte, error)
- func Serve(c *config.Config) error
- func WASMExecJS() string
- type AppJSData
- type AppWorkerJSData
- type IndexHTMLData
- type ManifestJSONData
Constants ¶
const ( // DefaultAppWorkersJS is the default template used in [MakeAppWorkerJS] to generate app-worker.js. DefaultAppWorkerJS = "" /* 2731-byte string literal not displayed */ // WASMExecJSGoCurrent is the wasm_exec.js file for the current version of Go. WASMExecJSGoCurrent = "" /* 18065-byte string literal not displayed */ // AppJS is the string used for [AppJSTmpl]. AppJS = "" /* 9450-byte string literal not displayed */ // ManifestJSON is the string used for [ManifestJSONTmpl]. ManifestJSON = "" /* 663-byte string literal not displayed */ // AppCSS is the string used for app.css. AppCSS = "" /* 2113-byte string literal not displayed */ // IndexHTML is the string used for [IndexHTMLTmpl]. IndexHTML = "" /* 1987-byte string literal not displayed */ )
Variables ¶
AppJSTmpl is the template used in MakeAppJS to build the app.js file
IndexHTMLTmpl is the template used in MakeIndexHTML to build the index.html file
var ManifestJSONTmpl = template.Must(template.New("manifest.webmanifest").Parse(ManifestJSON))
ManifestJSONTmpl is the template used in MakeManifestJSON to build the mainfest.webmanifest file
Functions ¶
func MakeAppWorkerJS ¶
MakeWorkerJS executes [config.Config.Web.ServiceWorkerTemplate]. If it empty, it sets it to DefaultAppWorkerJS.
func MakeFiles ¶
MakeFiles makes the necessary static web files based on the given configuration information.
func MakeIndexHTML ¶
MakeIndexHTML exectues IndexHTMLTmpl based on the given configuration information.
func MakeManifestJSON ¶
MakeManifestJSON exectues ManifestJSONTmpl based on the given configuration information.
func Serve ¶
Serve serves the build output directory on the default network address at the config port.
func WASMExecJS ¶
func WASMExecJS() string
WASMExecJS returns the wasm_exec.js file appropriate for the Go verison being used.
Types ¶
type AppJSData ¶
type AppJSData struct { Env string LoadingLabel string Wasm string WasmContentLengthHeader string WorkerJS string AutoUpdateInterval int64 }
AppJSData is the data passed to AppJSTmpl
type AppWorkerJSData ¶
AppWorkerJSData is the data passed to [config.Config.Web.ServiceWorkerTemplate]