requestid

package
v0.0.0-...-5e036e0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestIDHeader = "X-Request-Id"

RequestIDHeader is the name of the HTTP Header which contains the request id. Exported so that it can be changed by developers

View Source
var RequestIDKey = ctxKey{"request_id"}

RequestIDKey is the key that holds the unique request ID in a request context.

Functions

func Get

func Get(ctx context.Context) string

Get returns a request ID from the given context if one is present. Returns the empty string if a request ID cannot be found.

func HTTPMiddleware

func HTTPMiddleware(next http.Handler) http.Handler

func NextRequestID

func NextRequestID() uint64

NextRequestID generates the next request ID in the sequence.

func SSHMiddleware

func SSHMiddleware(next ssh.Handler) ssh.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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