Documentation
¶
Overview ¶
Package requestid provides utilities for managing request IDs in Go applications. It supports storing and retrieving request IDs from context, along with constants for common usage patterns like HTTP headers and log keys.
Index ¶
Constants ¶
View Source
const ( // Header is the standard HTTP header key for request IDs. Header = "x-request-id" // LogKey is the key used for request IDs in structured logging. LogKey = "requestId" )
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext extracts the request ID from the context. Returns an empty string if no request ID is set in the context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.