Help us shape the future of Go! Take the 2026 Go Developer Survey

requestid

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CorrelationIDKey      = "correlationID"
	OperationIDKey        = "operationID"
	ARMClientRequestIDKey = "armClientRequestID"

	// Details can be found here:
	// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md#client-request-headers
	RequestCorrelationIDHeader = "x-ms-correlation-request-id"
	// RequestAcsOperationIDHeader is the http header name ACS RP adds for operation ID (AKS specific)
	RequestAcsOperationIDHeader = "x-ms-acs-operation-id"
	// RequestARMClientRequestIDHeader  Caller-specified value identifying the request, in the form of a GUID
	RequestARMClientRequestIDHeader = "x-ms-client-request-id"
)

Variables

This section is empty.

Functions

func DefaultHeaderExtractor

func DefaultHeaderExtractor(r *http.Request) map[string]string

func NewRequestIDMiddleware

func NewRequestIDMiddleware() mux.MiddlewareFunc

NewRequestIDMiddleware creates a new RequestID middleware with the default extractor.

func NewRequestIDMiddlewareWithExtractor

func NewRequestIDMiddlewareWithExtractor(extractor HeaderExtractor) mux.MiddlewareFunc

NewRequestIDMiddlewareWithExtractor creates a new RequestID middleware with a custom extractor.

Types

type HeaderExtractor

type HeaderExtractor func(r *http.Request) map[string]string

HeaderExtractor defines a function to extract headers from an HTTP request. It returns a map where keys are metadata keys and values are the corresponding header values.

Jump to

Keyboard shortcuts

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