// 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/problem" "lincodex/backend/internal/adapter/primary/http/v1" "lincodex/backend/internal/adapter/secondary/postgres" "lincodex/backend/internal/adapter/secondary/prometheus" "lincodex/backend/internal/adapter/secondary/redis" "lincodex/backend/internal/adapter/secondary/seaweedfs" "lincodex/backend/internal/port/inbound" "lincodex/backend/internal/port/outbound" "lincodex/backend/internal/usecase/health" "log/slog" ) // Injectors from wire.go: // initialize receives the mail sender that start selected, so an unusable // EMAIL_PROVIDER fails before any dependency is created. func initialize(ctx context.Context, config2 config.Config, logger *slog.Logger, mailSender outbound.MailSender) (*Application, func(), error) { healthChecker, cleanup, err := postgres.NewHealthChecker(ctx, config2) if err != nil { return nil, nil, err } cache, cleanup2, err := redis.NewCache(config2, logger) if err != nil { cleanup() return nil, nil, err } storage, cleanup3, err := seaweedfs.NewStorage(config2) if err != nil { cleanup2() cleanup() return nil, nil, err } readiness := newReadiness(healthChecker, cache, storage) healthHandler := newHealthHandler(readiness, config2) responder := problem.NewResponder(logger) handler := v1.NewHandler(healthHandler, responder) denyAllSecurity := v1.NewDenyAllSecurity() metrics := prometheus.New() httpHandler, err := httpadapter.NewRouter(healthHandler, handler, denyAllSecurity, responder, metrics, logger) if err != nil { cleanup3() cleanup2() cleanup() return nil, nil, err } relay, cleanup4, err := newOutboxRelay(ctx, config2, logger, metrics) if err != nil { cleanup3() cleanup2() cleanup() return nil, nil, err } bootstrapEventConsumers, cleanup5, err := newEventConsumers(ctx, config2, logger, metrics) if err != nil { cleanup4() cleanup3() cleanup2() cleanup() return nil, nil, err } worker, cleanup6, err := newJobWorker(ctx, config2, logger, metrics) if err != nil { cleanup5() cleanup4() cleanup3() cleanup2() cleanup() return nil, nil, err } application := NewApplication(config2, httpHandler, metrics, logger, mailSender, relay, bootstrapEventConsumers, worker) return application, func() { cleanup6() cleanup5() cleanup4() cleanup3() cleanup2() cleanup() }, nil } // wire.go: func newHealthHandler(readiness inbound.Readiness, config2 config.Config) *v1.HealthHandler { return v1.NewHealthHandler(readiness, config2.ReadinessTimeout) } func newReadiness(postgres2 *postgres.HealthChecker, cache *redis.Cache, storage *seaweedfs.Storage) *health.Readiness { return health.NewReadiness(postgres2, cache, storage) }