Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takt-corp/gin-request-id
Gin middleware that adds `X-Request-ID` header to all request and responses for easy tracking.
https://github.com/takt-corp/gin-request-id
gin gin-gonic go golang request-id
Last synced: 3 months ago
JSON representation
Gin middleware that adds `X-Request-ID` header to all request and responses for easy tracking.
- Host: GitHub
- URL: https://github.com/takt-corp/gin-request-id
- Owner: takt-corp
- License: mit
- Created: 2022-10-27T15:44:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-18T23:20:36.000Z (11 months ago)
- Last Synced: 2024-06-20T15:01:05.408Z (5 months ago)
- Topics: gin, gin-gonic, go, golang, request-id
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - gin-request-id - Request-ID` header to all request and responses for easy tracking. (Repositories)
README
# X-Request-ID for Gin
Gin middleware that adds `X-Request-ID` header to all request and responses for easy tracking. If `X-Request-ID` header is present on the request the same value will be returned on the response. If it is empty, one will be generated and attached to the response.
[Learn more about X-Request-ID](https://stackoverflow.com/questions/25433258/what-is-the-x-request-id-http-header)
```go
r := gin.New()
r.Use(ginrequestid.RequestIDMiddleware)```