Discover Packages
github.com/refringe/anchor-lfs
middleware
package
Version:
v0.1.4
Opens a new window with list of versions in this module.
Published: Aug 13, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 11
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 per-IP rate limiting and structured request logging.
ClientIP extracts the client IP address from the request.
func GenerateRequestID() string
GenerateRequestID creates a short random hex string for request correlation.
Logging is HTTP middleware that logs each request with method, path, status
code, duration, bytes written, and client IP. It uses httpsnoop to correctly
capture the response status without breaking optional http.ResponseWriter
interfaces (Flusher, Hijacker, etc.).
RateLimit returns middleware that enforces per-IP rate limiting using the
provided limiter store.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.