Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RequestIDHeader is a constant containing the request header key RequestIDHeader = "X-Request-ID" // RequestCtxKey is a context containing the context key under which the // request ID is stored. RequestCtxKey = contextKey("requestID") )
Variables ¶
This section is empty.
Functions ¶
func RequestIDMiddleware ¶
RequestIDMiddleware is a net.http middleware that adds a unique UUID request ID to requests. If a request ID is already present in the request we use that one else we generate a random UUID. The request ID is added to our context so will be available within any downstream handlers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.