lab4: вложения в S3 (MinIO), reconciler PostgreSQL↔S3, тесты и CI

This commit is contained in:
2026-11-04 20:11:33 +03:00
parent ec540a1a72
commit 77b6e5c2c7
86 changed files with 6921 additions and 2 deletions
@@ -0,0 +1,25 @@
package middleware
import (
"log/slog"
"net/http"
"github.com/charawein/mtusi2026lab4/internal/transport/httputil"
)
func Recovery(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
if rec := recover(); rec != nil {
slog.Error("panic in handler",
"panic", rec,
"request_id", httputil.RequestIDFrom(r.Context()),
"method", r.Method,
"path", r.URL.Path,
)
httputil.WriteError(w, r, nil)
}
}()
next.ServeHTTP(w, r)
})
}