feat(api): add composite ogen handler for incremental operations

This commit is contained in:
shira committed 2026-10-05 21:20:46 +03:00
1 parent 0f206bfc29
commit b2f6e87bfe
6 files changed
+133 -6

No files matched your search

+3
View File
@@ -10,6 +10,7 @@ import (
"lincodex/backend/config"
httpadapter "lincodex/backend/internal/adapter/primary/http"
apiadapter "lincodex/backend/internal/adapter/primary/http/api"
httpmiddleware "lincodex/backend/internal/adapter/primary/http/middleware"
v1 "lincodex/backend/internal/adapter/primary/http/v1"
"lincodex/backend/internal/adapter/secondary/postgres"
@@ -28,9 +29,11 @@ func initialize(ctx context.Context, config config.Config, logger *slog.Logger)
seaweedfs.NewStorage,
wire.Bind(new(inbound.Readiness), new(*health.Readiness)),
wire.Bind(new(httpmiddleware.RequestMetrics), new(*metrics.Metrics)),
wire.Bind(new(apiadapter.Handler), new(*v1.Handler)),
newReadiness,
metrics.New,
newHealthHandler,
v1.NewHandler,
httpadapter.NewRouter,
NewApplication,
),
+3 -2
View File
@@ -40,15 +40,16 @@ func initialize(ctx context.Context, config2 config.Config, logger *slog.Logger)
}
readiness := newReadiness(healthChecker, cache, storage)
healthHandler := newHealthHandler(readiness, config2)
handler := v1.NewHandler(healthHandler)
metrics := prometheus.New()
handler, err := httpadapter.NewRouter(healthHandler, metrics, logger)
httpHandler, err := httpadapter.NewRouter(healthHandler, handler, metrics, logger)
if err != nil {
cleanup3()
cleanup2()
cleanup()
return nil, nil, err
}
application := NewApplication(config2, handler, metrics, logger)
application := NewApplication(config2, httpHandler, metrics, logger)
return application, func() {
cleanup3()
cleanup2()