Documentation
¶
Index ¶
- Variables
- func CheckRequestAuthorization(conf *config.SecurityConfig) func(http.Handler) http.Handler
- func CorsHeadersMiddleware(config *config.SecurityConfig) func(http.Handler) http.Handler
- func RequestIdMiddleware(next http.Handler) http.Handler
- func RequestLoggerMiddleware(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestIDHeader = "X-Request-Id"
View Source
var ValidRequestIdRegex = regexp.MustCompile("^[0-9a-f]{8}$")
Functions ¶
func CorsHeadersMiddleware ¶
func RequestIdMiddleware ¶
RequestIdMiddleware creates a HandlerFunc that obtains the request id from the request header, or failing that, creates a new request id, and places it in the request context. It also adds it to the response under the same header. This automatically also leads to all logging using this context to log the request id.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.