block-accounting/backend/internal/factory/wire_gen.go
2024-05-29 01:57:31 +03:00

47 lines
2.0 KiB
Go

// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package factory
import (
"github.com/emochka2007/block-accounting/internal/pkg/config"
"github.com/emochka2007/block-accounting/internal/service"
"github.com/emochka2007/block-accounting/internal/usecase/repository"
)
// Injectors from wire.go:
func ProvideService(c config.Config) (service.Service, func(), error) {
logger := provideLogger(c)
db, cleanup, err := repository.ProvideDatabaseConnection(c)
if err != nil {
return nil, nil, err
}
usersRepository := provideUsersRepository(db)
usersInteractor := provideUsersInteractor(logger, usersRepository)
authRepository := provideAuthRepository(db)
jwtInteractor := provideJWTInteractor(c, usersInteractor, authRepository)
authPresenter := provideAuthPresenter(jwtInteractor)
authController := provideAuthController(logger, usersInteractor, authPresenter, jwtInteractor)
organizationsRepository := provideOrganizationsRepository(db, usersRepository)
client, cleanup2 := provideRedisConnection(c)
cache := provideRedisCache(client, logger)
organizationsInteractor := provideOrganizationsInteractor(logger, organizationsRepository, cache)
organizationsPresenter := provideOrganizationsPresenter()
organizationsController := provideOrganizationsController(logger, organizationsInteractor, organizationsPresenter)
transactionsRepository := provideTxRepository(db)
transactionsInteractor := provideTxInteractor(logger, transactionsRepository, organizationsInteractor)
transactionsController := provideTxController(logger, transactionsInteractor)
participantsController := provideParticipantsController(logger, organizationsInteractor, usersInteractor)
rootController := provideControllers(logger, authController, organizationsController, transactionsController, participantsController)
server := provideRestServer(logger, rootController, c, jwtInteractor)
serviceService := service.NewService(logger, server)
return serviceService, func() {
cleanup2()
cleanup()
}, nil
}