block-accounting/backend/internal/factory/wire_gen.go

48 lines
2.3 KiB
Go
Raw Normal View History

2024-05-24 17:44:24 +00:00
// Code generated by Wire. DO NOT EDIT.
2024-05-25 13:00:21 +00:00
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
2024-05-24 17:44:24 +00:00
//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)
2024-05-26 18:20:14 +00:00
organizationsRepository := provideOrganizationsRepository(db, usersRepository)
transactionsRepository := provideTxRepository(db, organizationsRepository)
2024-05-25 13:00:21 +00:00
chainInteractor := provideChainInteractor(logger, c, transactionsRepository)
usersInteractor := provideUsersInteractor(logger, usersRepository, chainInteractor)
2024-05-24 17:44:24 +00:00
authRepository := provideAuthRepository(db)
jwtInteractor := provideJWTInteractor(c, usersInteractor, authRepository)
authPresenter := provideAuthPresenter(jwtInteractor)
client, cleanup2 := provideRedisConnection(c)
cache := provideRedisCache(client, logger)
organizationsInteractor := provideOrganizationsInteractor(logger, organizationsRepository, cache)
2024-05-27 18:08:19 +00:00
authController := provideAuthController(logger, usersInteractor, authPresenter, jwtInteractor, authRepository, organizationsInteractor)
2024-05-24 17:44:24 +00:00
organizationsPresenter := provideOrganizationsPresenter()
organizationsController := provideOrganizationsController(logger, organizationsInteractor, organizationsPresenter)
2024-05-27 21:29:05 +00:00
transactionsInteractor := provideTxInteractor(logger, transactionsRepository, organizationsInteractor, chainInteractor)
transactionsController := provideTxController(logger, transactionsInteractor, chainInteractor, organizationsInteractor)
2024-05-24 17:44:24 +00:00
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
}