Reusable HTTP middleware

go-http-middleware-kit

Reusable net/http middleware for backend services that want request IDs, real IP extraction, structured logs, panic recovery, and timeouts without pulling in a full framework.

Gonet/httpRequest IDsStructured logsRecoveryTimeouts

If you copied code from this repo: the low-friction intended path is direct — tip if it saved you implementation time; buy the review only if you want your own repo packaged better.

What is inside

  • RequestID middleware
  • RealIP middleware
  • RequestLogger on slog
  • Recovery middleware
  • Timeout middleware
  • Chain / Wrap helpers
  • small readable layout
  • practical production-minded defaults

Support

If go-http-middleware-kit already saved you copy-paste time, the shameless intended path is a direct thank-you tip on the support page.

  • Best payment notego-http-middleware-kit or request-id middleware
  • Low-friction tip¥9.9 / ¥19.9
  • Fastest path — WeChat Pay / Alipay on the support page
  • One-click follow-upsupport discussion
  • ¥29.9 quick read — one blunt repo / README first-impression pass
  • ¥99 async review — concrete packaging and README edits for your own backend repo
  • Best use — taking a technically okay repo and making it feel more reusable and credible