requestid

package
v0.0.0-...-4de7dfb Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

View Source
const HeaderKey = "X-Request-Id"

HeaderKey is the header key for the request ID.

View Source
const MaxRequestID = 64

MaxRequestID is the maximum allowed length for a request id.

Variables

This section is empty.

Functions

func AddToContext

func AddToContext(h http.Handler) http.Handler

AddToContext uses adds a unique requestid to the context and the response headers of each request.

func FromContext

func FromContext(ctx context.Context) string

FromContext returns the request ID from the context.

func Propagate

func Propagate(ctx context.Context, req *http.Request)

Propagate adds the request ID from the context to the request header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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