requestid

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendedRequestID

func ExtendedRequestID(opts ...Option) middleware.MiddlewareFunc

ExtendedRequestID is middleware that extracts the extended request ID from the API Gateway request context and sets it in the Go context.Context. If the extended request ID does not exist, an empty string is set.

func RequestID

func RequestID(opts ...Option) middleware.MiddlewareFunc

RequestID is middleware that extracts the request ID from the API Gateway request context and sets it in the Go context.Context. If the request ID does not exist, an empty string is set.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is the configuration for the RequestID and ExtendedRequestID middleware.

type CtxKey

type CtxKey struct{}

CtxKey is the default key type used to store the request ID within the context.

type Option

type Option func(*Config)

Option is a function type to modify the RequestID and ExtendedRequestID configuration.

func WithCtxKey

func WithCtxKey(ctxKey any) Option

WithCtxKey specifies the key of the request ID to be set in the context.

Jump to

Keyboard shortcuts

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