httpapi

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package httpapi owns the HTTP route tables shared by both listeners. The public listener requires bootstrapping and authentication; the loopback-only admin listener answers the same JSON API without either and serves no dashboard. Route rules are defined once in dashboard.RegisterAPI and v1.Register and mounted on both muxes; only the "/" catch-all differs (SPA fallback vs JSON 404). Authentication behavior comes from the requestsource in the request context, so the same handler instances serve both listeners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrivateMux

func BuildPrivateMux(apiHandler *v1.Handler, dashboardHandler *dashboard.Handler) *http.ServeMux

BuildPrivateMux mounts the JSON API only: /v1 and /api behave exactly as on public (minus authentication), every other path answers JSON 404. No SPA, no redirects, no dashboard HTML anywhere.

func BuildPublicMux

func BuildPublicMux(apiHandler *v1.Handler, dashboardHandler *dashboard.Handler) *http.ServeMux

BuildPublicMux mounts the full surface: /v1 and /api answer JSON, everything else serves the dashboard SPA (redirects allowed).

Types

This section is empty.

Jump to

Keyboard shortcuts

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