web

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets embed.FS

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string
}

Config holds the web handler configuration.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves the embedded SPA: hashed assets under /assets/ with long-lived immutable cache, everything else falls back to index.html.

func NewHandler

func NewHandler(cfg Config) (*Handler, error)

NewHandler constructs a Handler. The dist/ directory must be populated (by task web:build) before calling this at startup.

func (*Handler) HealthCheck

func (h *Handler) HealthCheck() error

HealthCheck reports embed integrity.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes the request: /assets/* gets immutable cache headers, everything else gets the SPA index.

type WidgetsHandler

type WidgetsHandler struct {
	// contains filtered or unexported fields
}

WidgetsHandler serves files from the widget pack asset directory. URL pattern: /widgets/<pack>/<version>/<file>

func NewWidgetsHandler

func NewWidgetsHandler(packDir string) *WidgetsHandler

NewWidgetsHandler creates a handler for serving widget pack assets.

func (*WidgetsHandler) ServeHTTP

func (h *WidgetsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves widget pack assets from disk.

Jump to

Keyboard shortcuts

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