-
Notifications
You must be signed in to change notification settings - Fork 12
/
wire_gen.go
67 lines (62 loc) · 3.68 KB
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package main
import (
"github.com/devtron-labs/common-lib/monitoring"
"github.com/devtron-labs/common-lib/pubsub-lib"
"github.com/devtron-labs/git-sensor/api"
"github.com/devtron-labs/git-sensor/app"
"github.com/devtron-labs/git-sensor/internals"
"github.com/devtron-labs/git-sensor/internals/logger"
"github.com/devtron-labs/git-sensor/internals/sql"
"github.com/devtron-labs/git-sensor/pkg"
"github.com/devtron-labs/git-sensor/pkg/git"
)
// Injectors from wire.go:
func InitializeApp() (*app.App, error) {
sugaredLogger := logger.NewSugaredLogger()
config, err := sql.GetConfig()
if err != nil {
return nil, err
}
db, err := sql.NewDbConnection(config, sugaredLogger)
if err != nil {
return nil, err
}
materialRepositoryImpl := sql.NewMaterialRepositoryImpl(db)
configuration, err := internals.ParseConfiguration()
if err != nil {
return nil, err
}
gitManagerImpl := git.NewGitManagerImpl(sugaredLogger, configuration)
repositoryManagerImpl := git.NewRepositoryManagerImpl(sugaredLogger, configuration, gitManagerImpl)
repositoryManagerAnalyticsImpl := git.NewRepositoryManagerAnalyticsImpl(repositoryManagerImpl, gitManagerImpl, configuration, sugaredLogger)
gitProviderRepositoryImpl := sql.NewGitProviderRepositoryImpl(db)
ciPipelineMaterialRepositoryImpl := sql.NewCiPipelineMaterialRepositoryImpl(db, sugaredLogger)
repositoryLocker := internals.NewRepositoryLocker(sugaredLogger)
pubSubClientServiceImpl, err := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger)
if err != nil {
return nil, err
}
webhookEventRepositoryImpl := sql.NewWebhookEventRepositoryImpl(db)
webhookEventParsedDataRepositoryImpl := sql.NewWebhookEventParsedDataRepositoryImpl(db)
webhookEventDataMappingRepositoryImpl := sql.NewWebhookEventDataMappingRepositoryImpl(db)
webhookEventDataMappingFilterResultRepositoryImpl := sql.NewWebhookEventDataMappingFilterResultRepositoryImpl(db)
webhookEventBeanConverterImpl := git.NewWebhookEventBeanConverterImpl()
webhookEventServiceImpl := git.NewWebhookEventServiceImpl(sugaredLogger, webhookEventRepositoryImpl, webhookEventParsedDataRepositoryImpl, webhookEventDataMappingRepositoryImpl, webhookEventDataMappingFilterResultRepositoryImpl, materialRepositoryImpl, pubSubClientServiceImpl, webhookEventBeanConverterImpl)
webhookEventParserImpl := git.NewWebhookEventParserImpl(sugaredLogger)
webhookHandlerImpl := git.NewWebhookHandlerImpl(sugaredLogger, webhookEventServiceImpl, webhookEventParserImpl)
gitWatcherImpl, err := git.NewGitWatcherImpl(repositoryManagerImpl, materialRepositoryImpl, sugaredLogger, ciPipelineMaterialRepositoryImpl, repositoryLocker, pubSubClientServiceImpl, webhookHandlerImpl, configuration, gitManagerImpl)
if err != nil {
return nil, err
}
repoManagerImpl := pkg.NewRepoManagerImpl(sugaredLogger, materialRepositoryImpl, repositoryManagerImpl, repositoryManagerAnalyticsImpl, gitProviderRepositoryImpl, ciPipelineMaterialRepositoryImpl, repositoryLocker, gitWatcherImpl, webhookEventRepositoryImpl, webhookEventParsedDataRepositoryImpl, webhookEventDataMappingRepositoryImpl, webhookEventDataMappingFilterResultRepositoryImpl, webhookEventBeanConverterImpl, configuration, gitManagerImpl)
restHandlerImpl := api.NewRestHandlerImpl(repoManagerImpl, sugaredLogger)
monitoringRouter := monitoring.NewMonitoringRouter(sugaredLogger)
muxRouter := api.NewMuxRouter(sugaredLogger, restHandlerImpl, monitoringRouter)
grpcHandlerImpl := api.NewGrpcHandlerImpl(repoManagerImpl, sugaredLogger)
appApp := app.NewApp(muxRouter, sugaredLogger, gitWatcherImpl, db, pubSubClientServiceImpl, grpcHandlerImpl)
return appApp, nil
}