https://github.com/c4milo/handlers
Go's HTTP handlers I use in my projects
https://github.com/c4milo/handlers
compression csrf-protection go golang grpc-gateway http-handler logger
Last synced: 12 months ago
JSON representation
Go's HTTP handlers I use in my projects
- Host: GitHub
- URL: https://github.com/c4milo/handlers
- Owner: c4milo
- License: mpl-2.0
- Created: 2015-01-14T18:36:01.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T23:29:02.000Z (about 3 years ago)
- Last Synced: 2025-03-18T11:39:25.414Z (12 months ago)
- Topics: compression, csrf-protection, go, golang, grpc-gateway, http-handler, logger
- Language: Go
- Homepage:
- Size: 192 KB
- Stars: 53
- Watchers: 5
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Go HTTP Handlers
[](https://godoc.org/github.com/c4milo/handlers)
[](https://travis-ci.org/c4milo/handlers)
This repository contains HTTP middlewares that I use in my own Go projects.
Feel free to use them too!
* **Compressor:** Applies gzip compression to the response body, if the client supports it.
* **Logger:** Logs HTTP requests, including: remote user, remote IP, latency, request id, txbytes, rxbytes, status, etc.
* **HTTP Method Override:** Provides an alternative for clients that don't support methods other than POST or GET to override the HTTP method.
* **CSRF protection:** Provides protection for endpoints from CSRF attacks.
* **Session:** Secure cookie session management with external store support.
* **GRPCUtil:** A convenient handler to initialize a gRPC server and OpenAPI proxy.
For examples on how to use these handlers, please refer to the Go documentation linked at the top.