middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestIDHeader is a constant containing the request header key
	RequestIDHeader = "X-Request-ID"

	// RequestCtxKey is a context containing the context key under which the
	// request ID is stored.
	RequestCtxKey = contextKey("requestID")
)

Variables

This section is empty.

Functions

func RequestIDMiddleware

func RequestIDMiddleware(next http.Handler) http.Handler

RequestIDMiddleware is a net.http middleware that adds a unique UUID request ID to requests. If a request ID is already present in the request we use that one else we generate a random UUID. The request ID is added to our context so will be available within any downstream handlers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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