A Go HTTP middleware library for building robust request/response pipelines with structured errors, logging, routing, and sessions.
Migrated from https://github.com/rsgcata/go-http
- Response utilities
- ResponseBuilder for JSON, text, and HTML
- Enhanced ResponseWriter that tracks status codes
- Error handling
HTTPErrorinterface and error categories- Optional structured logging with context
- Middleware
- Access logging, panic recovery, timeouts, path normalization, CSRF protection, session management
- Router utilities
- Named middleware chaining with per-route overrides
- Sessions
- Manager, middleware integration, memory/MySQL storage, flashes, GC lifecycle
This README intentionally avoids code examples. For in‑depth, runnable examples of every feature, see the _examples/ directory in the repository.
- Start with
_examples/to explore focused, one-file examples - See
http/session/README.mdfor a sessions overview
- Go 1.24.1 or later
- Standard library for core functionality; testing uses
github.com/stretchr/testify
See the LICENSE file for details.