web

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package web hosts the non-SPA HTTP surface: the SPA shell, the API docs shell, JSON auth endpoints (login / register / logout / config), and the OIDC redirect dance. Page rendering is owned entirely by the Svelte SPA; this package is intentionally small.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(r chi.Router, h *Handler)

Mount wires webui routes onto r. Caller is responsible for separately mounting the SPA shell + API docs on the desired paths.

Types

type Deps

type Deps struct {
	Auth         auth.Manager
	OIDC         auth.OIDCManager
	Limiter      auth.Limiter
	MediaServers mediaserver.Manager
}

Deps is the dependency set required by the web Handler.

type Handler

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

Handler exposes the non-SPA webui routes. Constructed in the composition root with the auth service-layer deps.

func New

func New(d Deps) *Handler

New constructs a Handler from the given Deps.

func (*Handler) APIDocs

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

APIDocs serves the embedded Scalar shell at /api/docs. The bundled docs JS + CSS live under /static/.

func (*Handler) SPAShell

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

SPAShell serves the embedded Svelte single-page app entry HTML. Every non-API, non-static path returns the same shell; Routify takes over routing client-side from there. The shell loads the bundled JS + CSS from /static/dist/.

Jump to

Keyboard shortcuts

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