middleware

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDKey ctxKeyRequestID = 0

RequestIDKey is the key that holds the unique request ID in a request context.

Variables

This section is empty.

Functions

func GetReqID

func GetReqID(ctx context.Context) string

GetReqID returns a request ID from the given context if one is present. Returns the empty string if a request ID cannot be found.

func RequestID

func RequestID(headerName string) func(next http.Handler) http.Handler

RequestID is a middleware that injects a request ID into the context and logger of each request. A request ID is an UUID, example: 9e21998d-d36f-48ef-831b-30e643536c88.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL