RequestID adds a unique request id to the context
()
| 27 | |
| 28 | // RequestID adds a unique request id to the context |
| 29 | func RequestID() gin.HandlerFunc { |
| 30 | return func(c *gin.Context) { |
| 31 | reqID := util.UUID() |
| 32 | ginzap.NewContext(c, zap.String(setting.RequestID, reqID)) |
| 33 | |
| 34 | c.Set(setting.RequestID, reqID) |
| 35 | |
| 36 | c.Next() |
| 37 | } |
| 38 | } |
nothing calls this directly
no test coverage detected