initial commit
This commit is contained in:
commit
88c14b627e
224 files changed
+17204
No files matched your search
@@ -0,0 +1,46 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate go run -mod=mod github.com/goforj/wire/cmd/wire
|
||||
//go:build !wireinject
|
||||
// +build !wireinject
|
||||
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"lincodex/backend/config"
|
||||
"lincodex/backend/internal/adapter/primary/http"
|
||||
"lincodex/backend/internal/adapter/primary/http/v1"
|
||||
"lincodex/backend/internal/adapter/secondary/postgres"
|
||||
"lincodex/backend/internal/adapter/secondary/prometheus"
|
||||
"lincodex/backend/internal/port/inbound"
|
||||
"lincodex/backend/internal/usecase/health"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func initialize(ctx context.Context, config2 config.Config, logger *slog.Logger) (*Application, func(), error) {
|
||||
healthChecker, cleanup, err := postgres.NewHealthChecker(ctx, config2)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
readiness := health.NewReadiness(healthChecker)
|
||||
healthHandler := newHealthHandler(readiness, config2)
|
||||
metrics := prometheus.New()
|
||||
handler, err := httpadapter.NewRouter(healthHandler, metrics, logger)
|
||||
if err != nil {
|
||||
cleanup()
|
||||
return nil, nil, err
|
||||
}
|
||||
application := NewApplication(config2, handler, metrics, logger)
|
||||
return application, func() {
|
||||
cleanup()
|
||||
}, nil
|
||||
}
|
||||
|
||||
// wire.go:
|
||||
|
||||
func newHealthHandler(readiness inbound.Readiness, config2 config.Config) *v1.HealthHandler {
|
||||
return v1.NewHealthHandler(readiness, config2.ReadinessTimeout)
|
||||
}
|
||||
Reference in new issue
Block a user