requestid

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Header = "X-Request-ID"
	Key    = "request_id"
)

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) string

FromContext returns the request id stored in context.

func Get

func Get(c *gin.Context) string

func Middleware

func Middleware() gin.HandlerFunc

Middleware passes through X-Request-ID or generates one when missing.

func WithRequestID

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

WithRequestID stores a request id in context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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