MCPcopy
hub / github.com/koderover/zadig / RequestID

Function RequestID

pkg/middleware/gin/request_id.go:29–38  ·  view source on GitHub ↗

RequestID adds a unique request id to the context

()

Source from the content-addressed store, hash-verified

27
28// RequestID adds a unique request id to the context
29func 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}

Callers

nothing calls this directly

Calls 5

UUIDFunction · 0.92
NewContextFunction · 0.92
NextMethod · 0.80
SetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected