// Package middleware provides HTTP middleware for the chi router.
package middleware

import (
	"context"
)

type ctxKey string

// RequestIDKey is the context key storing the current request ID.
const RequestIDKey ctxKey = "request_id"

// RequestIDFrom returns the request ID stored in ctx (empty if absent).
func RequestIDFrom(ctx context.Context) string {
	if v, ok := ctx.Value(RequestIDKey).(string); ok {
		return v
	}
	return ""
}
