/gin-request-id

Gin middleware that adds `X-Request-ID` header to all request and responses for easy tracking.

Primary LanguageGoMIT LicenseMIT

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

    r := gin.New()
    r.Use(ginrequestid.RequestIDMiddleware)