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

48 lines
2.2 KiB
Go

// Code generated by Wire. DO NOT EDIT.
//go:generate go run -mod=mod 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)
transactionsRepository := provideTxRepository(db)
chainInteractor := provideChainInteractor(logger, c, transactionsRepository)
usersInteractor := provideUsersInteractor(logger, usersRepository, chainInteractor)
authRepository := provideAuthRepository(db)
jwtInteractor := provideJWTInteractor(c, usersInteractor, authRepository)
authPresenter := provideAuthPresenter(jwtInteractor)
authController := provideAuthController(logger, usersInteractor, authPresenter, jwtInteractor, authRepository)
organizationsRepository := provideOrganizationsRepository(db, usersRepository)
client, cleanup2 := provideRedisConnection(c)
cache := provideRedisCache(client, logger)
organizationsInteractor := provideOrganizationsInteractor(logger, organizationsRepository, cache)
organizationsPresenter := provideOrganizationsPresenter()
organizationsController := provideOrganizationsController(logger, organizationsInteractor, organizationsPresenter)
transactionsInteractor := provideTxInteractor(logger, transactionsRepository, organizationsInteractor)
transactionsController := provideTxController(logger, transactionsInteractor, chainInteractor, organizationsInteractor)
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
}