Documentation
¶
Overview ¶
Package reqid gives each HTTP request a relay-minted ULID, echoes it as X-Relay-Request-ID, and carries it with a request-scoped logger in the context. A caller's X-Request-ID is carried separately as the client id.
Index ¶
Constants ¶
const ( HeaderInbound = "X-Request-ID" HeaderOutbound = "X-Relay-Request-ID" )
Variables ¶
This section is empty.
Functions ¶
func ClientID ¶ added in v0.10.1
ClientID returns the caller's own X-Request-ID, empty when absent or invalid.
func Middleware ¶
Middleware always mints the request id: it keys stored records, so a caller must not be able to choose or repeat it. A valid inbound X-Request-ID is kept apart as the client id and echoed back unchanged.
Types ¶
This section is empty.