webui

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package webui embeds the built dashboard (web/vite.config.ts's outDir) into the musterd binary, so a copy of the binary moved away from the checkout still serves its own frontend (kb:adr/connection-dashboard-embedded-in-binary). internal/server picks between this embedded tree and an on-disk override (-web-dist) at startup; this package only exposes the embedded tree and a predicate for "does this FS actually contain a built dashboard".

The `all:assets` pattern (rather than plain `assets`) is required: without the `all:` prefix, the embed directive silently drops dotfiles, and assets/.gitkeep — committed so a fresh clone's embed pattern always resolves before any `npm run build` has run (kb:adr/connection-built-assets-ignored-with-gitkeep) — would vanish from the embedded tree along with every real dotfile a future build might add.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns the embedded dashboard tree rooted at assets/ (so callers see index.html, not assets/index.html). Panics only if the embed declaration itself is malformed, which a successful build already rules out — fs.Sub on a directory go:embed proved exists cannot fail in practice.

func HasDashboard

func HasDashboard(fsys fs.FS) bool

HasDashboard reports whether fsys contains a built dashboard (an index.html at its root). Factored to take an fs.FS rather than calling FS() itself so the fail-fast startup check (kb:adr/connection-missing-web-build-fails-fast) is unit-testable against an injected fstest.MapFS — a real post-web-build embed always contains index.html, so that branch is otherwise unreachable from a normally compiled binary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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