initial commit
This commit is contained in:
commit
88c14b627e
224 files changed
+17204
No files matched your search
@@ -0,0 +1,41 @@
|
||||
//go:build wireinject
|
||||
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"github.com/goforj/wire"
|
||||
|
||||
"lincodex/backend/config"
|
||||
httpadapter "lincodex/backend/internal/adapter/primary/http"
|
||||
httpmiddleware "lincodex/backend/internal/adapter/primary/http/middleware"
|
||||
v1 "lincodex/backend/internal/adapter/primary/http/v1"
|
||||
"lincodex/backend/internal/adapter/secondary/postgres"
|
||||
metrics "lincodex/backend/internal/adapter/secondary/prometheus"
|
||||
"lincodex/backend/internal/port/inbound"
|
||||
"lincodex/backend/internal/port/outbound"
|
||||
"lincodex/backend/internal/usecase/health"
|
||||
)
|
||||
|
||||
func initialize(ctx context.Context, config config.Config, logger *slog.Logger) (*Application, func(), error) {
|
||||
wire.Build(
|
||||
wire.NewSet(
|
||||
postgres.NewHealthChecker,
|
||||
wire.Bind(new(outbound.ReadinessChecker), new(*postgres.HealthChecker)),
|
||||
wire.Bind(new(inbound.Readiness), new(*health.Readiness)),
|
||||
wire.Bind(new(httpmiddleware.RequestMetrics), new(*metrics.Metrics)),
|
||||
health.NewReadiness,
|
||||
metrics.New,
|
||||
newHealthHandler,
|
||||
httpadapter.NewRouter,
|
||||
NewApplication,
|
||||
),
|
||||
)
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
func newHealthHandler(readiness inbound.Readiness, config config.Config) *v1.HealthHandler {
|
||||
return v1.NewHealthHandler(readiness, config.ReadinessTimeout)
|
||||
}
|
||||
Reference in new issue
Block a user