Discover Packages
github.com/dotwaffle/peeringdb-plus
internal
middleware
package
Version:
v1.8.0
Opens a new window with list of versions in this module.
Published: Mar 26, 2026
License: BSD-3-Clause
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package middleware provides HTTP middleware for the PeeringDB Plus server.
CORS returns middleware that adds CORS headers per OPS-06.
Origins are configured via the AllowedOrigins field.
Logging returns middleware that logs each HTTP request with method, path, status,
duration, and trace context (trace_id, span_id) when available.
Uses structured slog per OBS-1, OBS-5 with LogAttrs for attribute-based API.
Recovery returns middleware that recovers from panics in downstream handlers.
Logs the panic with stack trace via slog and returns 500 to the client.
type CORSInput struct {
AllowedOrigins string
}
CORSInput holds configuration for the CORS middleware.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.