middleware

package
v0.0.0-...-30f5d3c Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDHeaderName = "x-devbot-request-id"

RequestIDHeaderName is the name of the header used to signal and set the incoming request ID if it's missing.

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 GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID provides the request ID of the request associated with the given context.

func RequestID

func RequestID(next http.Handler) http.Handler

RequestID creates an HTTP middleware for go-chi web framework that ensures a request ID is set on requests.

func RequestLoggerFactory

func RequestLoggerFactory(logResponseBody bool) func(http.Handler) http.Handler

RequestLoggerFactory creates an HTTP request logging middleware for go-chi web framework.

Types

This section is empty.

Jump to

Keyboard shortcuts

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