requestid

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package requestid assigns HTTP request identifiers and bounds their log representation.

Index

Constants

View Source
const Header = "X-Request-ID"

Header is shared by the client, application, and upstream proxy.

Variables

This section is empty.

Functions

func Handler

func Handler(next http.Handler, trustClientHeader bool) http.Handler

Handler assigns one ID before downstream middleware runs. Client IDs are accepted only when the caller explicitly trusts the incoming proxy headers.

func LogValue

func LogValue(r *http.Request) string

LogValue limits untrusted request IDs to 255 bytes in structured logs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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