diff --git a/server/middleware/constants.go b/server/middleware/constants.go new file mode 100644 index 0000000..65bee4c --- /dev/null +++ b/server/middleware/constants.go @@ -0,0 +1,8 @@ +package middleware + +type contextKey string + +const ( + RequestIDKey contextKey = "request_id" + XTestTimeoutKey contextKey = "X-Test-Timeout" +) diff --git a/server/middleware/request_id.go b/server/middleware/request_id.go index f8ed2a0..7521ff1 100644 --- a/server/middleware/request_id.go +++ b/server/middleware/request_id.go @@ -8,11 +8,6 @@ import ( "github.com/google/uuid" ) -type contextKey string - -// RequestIDKey is the key used to store the request ID in the context. -const RequestIDKey contextKey = "request_id" - // RequestID middleware adds a unique request ID to the context // and sets it in the response header. func RequestID(next http.Handler) http.Handler {