requestid

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDKey contextKey = "request_id"

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) string

FromContext extracts the request ID from the context. Returns empty string if request ID is not found.

func FromContextPtr

func FromContextPtr(ctx context.Context) *string

func FromRequest

func FromRequest(r *http.Request) string

FromRequest extracts the request ID from the HTTP request context. Returns empty string if request ID is not found.

func Generate

func Generate() string

Generate creates a new unique request ID

func ToContext

func ToContext(ctx context.Context, requestID string) context.Context

ToContext adds a request ID to the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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