webui

package
v0.210.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 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

Overview

Package webui embeds the gofer web console static assets into the binary so `serve` can mount the SPA without any external files.

A bare `go build` (without first running `make web`) still compiles because dist/ always contains placeholder.html — the //go:embed directive needs at least one file present. When a real build is present (dist/index.html), Handler serves the SPA with index.html fallback for unknown routes; otherwise it serves the placeholder page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler() (http.Handler, bool)

Handler returns the web console static handler and whether a real build is present (true) vs the build-time placeholder (false). When dist/index.html exists it serves the SPA (unknown routes fall back to index.html); otherwise it serves the placeholder page for any GET. Callers (the HTTP server) GET-gate requests before delegating here.

func HandlerForDir

func HandlerForDir(dir string) (http.Handler, bool)

HandlerForDir serves the web console from an on-disk directory (dev convenience, P7): `gofer serve --web-dir web/dist` avoids re-embedding via `make web` on every front-end change. dir must be the built SPA root (containing index.html). Returns the handler and whether a real build is present (index.html exists).

Types

This section is empty.

Jump to

Keyboard shortcuts

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