Documentation
¶
Overview ¶
Package requestid gives every request an identifier, reusing the one the client or an upstream proxy sent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the request's identifier. Without the middleware, it falls back to the X-Request-ID request header.
func New ¶
func New(configs ...Config) zinc.Middleware
New reuses the request's identifier or generates one, and mirrors it into both the request and the response headers.
Types ¶
type Config ¶
type Config struct {
// Header carries the identifier on the request and the response.
Header string
// Generate creates identifiers. Nil uses Random.
Generate Generator
}
Config controls the header and identifier generation. The zero value uses X-Request-ID and random 128-bit identifiers.
Click to show internal directories.
Click to hide internal directories.