
httpserver
Package httpserver constructs the HTTP listener the daemon serves S3, admin, UI, health, and metrics traffic on. It owns route registration, middleware composition, TLS config (including the cert reloader for SIGHUP rotation), and the optional separate metrics listener.
Index
Constants
Daemon mode strings. registerS3Handler and registerUIHandler are only mounted in “api” and “all” modes; worker-only mode exposes neither.
DrainTimeout is the default Shutdown deadline used by the runtime when the caller does not supply one. Exported so tests can match the production value without coupling to a magic number.
type Deps
Deps holds the dependencies New requires.
type HealthDeps
HealthDeps holds the signals the health and readiness handlers read.
type Server
Server bundles the main HTTP listener with its optional separate metrics listener and the TLS cert reloader. Run starts both listeners; Shutdown closes them in the right order. The cert reloader is exposed so the reload coordinator can refresh certificates without reaching into the listener internals.
func New
New constructs the HTTP server with all routes mounted and TLS configured. It does not start any listener; call Run to do that.
func (*Server) CertReloader
CertReloader returns the TLS cert reloader, or nil when TLS is not configured. The reload coordinator calls Reload on this to refresh certificates on SIGHUP.
func (*Server) Run
Run starts the metrics listener (if separate) and the main listener. It blocks until either listener returns. The error channel returned by the main listener is forwarded so the runtime can distinguish a natural shutdown (http.ErrServerClosed) from a real failure.
func (*Server) Shutdown
Shutdown drains the main listener (with the supplied context’s timeout) and the metrics listener if present. Errors are logged but do not abort the shutdown sequence; the runtime owns final teardown ordering.
Generated by gomarkdoc