requestuuid

package
v0.0.0-...-545971b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(r *http.Request) *http.Request

Generate the request ID and store in the request context.

func Get

func Get(r *http.Request) string

Get returns the request ID from the request context.

func Middleware

func Middleware(h http.Handler) http.Handler

Middleware add a unique request ID to every request.

func Set

func Set(r *http.Request, value string) *http.Request

Set the request ID in the request context.

Types

type AmbientContextKey

type AmbientContextKey string

AmbientContextKey is a context key.

const AmbientUUID AmbientContextKey = "ambient_requestid"

AmbientUUID is the context key to support unique requests.

Jump to

Keyboard shortcuts

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