Documentation ¶
Index ¶
Constants ¶
View Source
const (
RequestIDHeaderKey = "X-Request-ID"
)
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(u, p string) func(httprouter.Handle) httprouter.Handle
func Logger ¶
func Logger(l *logrus.Logger) func(httprouter.Handle) httprouter.Handle
func Logging ¶
func Logging(fn httprouter.Handle) httprouter.Handle
func RequestID ¶
func RequestID(fn httprouter.Handle) httprouter.Handle
Request ID Middleware. Checks the X-Request-ID header. If not found, generates a new uuid, and inserts whichever on the context before calling the next function. Should generally be the outermost middleware, so that all other middlewares have a request id available.
Types ¶
type RequestIDContextKey ¶
type RequestIDContextKey struct{}
Click to show internal directories.
Click to hide internal directories.