-
Notifications
You must be signed in to change notification settings - Fork 11
/
wire_gen.go
79 lines (74 loc) · 3.4 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
68
69
70
71
72
73
74
75
76
77
78
79
// 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/helmLib/registry"
"github.com/devtron-labs/common-lib/monitoring"
"github.com/devtron-labs/common-lib/utils/grpc"
"github.com/devtron-labs/common-lib/utils/k8s"
"github.com/devtron-labs/kubelink/api/router"
"github.com/devtron-labs/kubelink/config"
"github.com/devtron-labs/kubelink/converter"
"github.com/devtron-labs/kubelink/internals/lock"
"github.com/devtron-labs/kubelink/internals/logger"
"github.com/devtron-labs/kubelink/pkg/asyncProvider"
"github.com/devtron-labs/kubelink/pkg/cluster"
"github.com/devtron-labs/kubelink/pkg/k8sInformer"
"github.com/devtron-labs/kubelink/pkg/service"
"github.com/devtron-labs/kubelink/pkg/service/commonHelmService"
"github.com/devtron-labs/kubelink/pkg/service/fluxService"
"github.com/devtron-labs/kubelink/pkg/service/helmApplicationService"
"github.com/devtron-labs/kubelink/pkg/sql"
)
// Injectors from Wire.go:
func InitializeApp() (*App, error) {
sugaredLogger := logger.NewSugaredLogger()
chartRepositoryLocker := lock.NewChartRepositoryLocker(sugaredLogger)
helmReleaseConfig, err := config.GetHelmReleaseConfig()
if err != nil {
return nil, err
}
k8sServiceImpl, err := commonHelmService.NewK8sServiceImpl(sugaredLogger, helmReleaseConfig)
if err != nil {
return nil, err
}
sqlConfig, err := sql.GetConfig()
if err != nil {
return nil, err
}
db, err := sql.NewDbConnection(sqlConfig, sugaredLogger)
if err != nil {
return nil, err
}
clusterRepositoryImpl := repository.NewClusterRepositoryImpl(db, sugaredLogger)
runtimeConfig, err := k8s.GetRuntimeConfig()
if err != nil {
return nil, err
}
k8sK8sServiceImpl := k8s.NewK8sUtil(sugaredLogger, runtimeConfig)
clusterBeanConverterImpl := converter.NewConverterImpl()
runnable := asyncProvider.NewAsyncRunnable(sugaredLogger)
k8sInformerImpl, err := k8sInformer.Newk8sInformerImpl(sugaredLogger, clusterRepositoryImpl, helmReleaseConfig, k8sK8sServiceImpl, clusterBeanConverterImpl, runnable)
if err != nil {
return nil, err
}
commonHelmServiceImpl := commonHelmService.NewCommonHelmServiceImpl(sugaredLogger, k8sK8sServiceImpl, clusterBeanConverterImpl, k8sServiceImpl, helmReleaseConfig)
defaultSettingsGetterImpl := registry.NewDefaultSettingsGetter(sugaredLogger)
settingsFactoryImpl := registry.NewSettingsFactoryImpl(defaultSettingsGetterImpl)
helmAppServiceImpl, err := helmApplicationService.NewHelmAppServiceImpl(sugaredLogger, k8sServiceImpl, k8sInformerImpl, helmReleaseConfig, k8sK8sServiceImpl, clusterBeanConverterImpl, clusterRepositoryImpl, commonHelmServiceImpl, settingsFactoryImpl)
if err != nil {
return nil, err
}
fluxApplicationServiceImpl := fluxService.NewFluxApplicationServiceImpl(sugaredLogger, clusterRepositoryImpl, k8sK8sServiceImpl, clusterBeanConverterImpl, commonHelmServiceImpl)
applicationServiceServerImpl := service.NewApplicationServiceServerImpl(sugaredLogger, chartRepositoryLocker, helmAppServiceImpl, fluxApplicationServiceImpl)
monitoringRouter := monitoring.NewMonitoringRouter(sugaredLogger)
routerImpl := router.NewRouter(sugaredLogger, monitoringRouter)
configuration, err := grpc.GetConfiguration()
if err != nil {
return nil, err
}
app := NewApp(sugaredLogger, applicationServiceServerImpl, routerImpl, k8sInformerImpl, db, configuration)
return app, nil
}