/
wire_gen.go
114 lines (101 loc) · 2.79 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package report_di
import (
"github.com/google/wire"
"github.com/shortlink-org/shortlink/internal/di"
"github.com/shortlink-org/shortlink/internal/di/pkg/autoMaxPro"
"github.com/shortlink-org/shortlink/internal/di/pkg/config"
"github.com/shortlink-org/shortlink/internal/di/pkg/context"
"github.com/shortlink-org/shortlink/internal/di/pkg/logger"
"github.com/shortlink-org/shortlink/internal/di/pkg/profiling"
"github.com/shortlink-org/shortlink/internal/di/pkg/traicing"
"github.com/shortlink-org/shortlink/pkg/logger"
"github.com/shortlink-org/shortlink/pkg/observability/monitoring"
"go.opentelemetry.io/otel/trace"
)
// Injectors from wire.go:
func InitializeReportService() (*ReportService, func(), error) {
context, cleanup, err := ctx.New()
if err != nil {
return nil, nil, err
}
logger, cleanup2, err := logger_di.New(context)
if err != nil {
cleanup()
return nil, nil, err
}
configConfig, err := config.New()
if err != nil {
cleanup2()
cleanup()
return nil, nil, err
}
monitoringMonitoring, cleanup3, err := monitoring.New(context, logger)
if err != nil {
cleanup2()
cleanup()
return nil, nil, err
}
tracerProvider, cleanup4, err := traicing_di.New(context, logger)
if err != nil {
cleanup3()
cleanup2()
cleanup()
return nil, nil, err
}
pprofEndpoint, err := profiling.New(context, logger)
if err != nil {
cleanup4()
cleanup3()
cleanup2()
cleanup()
return nil, nil, err
}
autoMaxProAutoMaxPro, cleanup5, err := autoMaxPro.New(logger)
if err != nil {
cleanup4()
cleanup3()
cleanup2()
cleanup()
return nil, nil, err
}
reportService := NewReportService(logger, configConfig, monitoringMonitoring, tracerProvider, pprofEndpoint, autoMaxProAutoMaxPro)
return reportService, func() {
cleanup5()
cleanup4()
cleanup3()
cleanup2()
cleanup()
}, nil
}
// wire.go:
type ReportService struct {
// Common
Log logger.Logger
Config *config.Config
// Observability
Tracer trace.TracerProvider
Monitoring *monitoring.Monitoring
PprofEndpoint profiling.PprofEndpoint
AutoMaxPro autoMaxPro.AutoMaxPro
}
// ReportService =======================================================================================================
var ReportSet = wire.NewSet(di.DefaultSet, NewReportService)
func NewReportService(
log logger.Logger, config2 *config.Config, monitoring2 *monitoring.Monitoring,
tracer trace.TracerProvider,
pprofHTTP profiling.PprofEndpoint,
autoMaxProcsOption autoMaxPro.AutoMaxPro,
) *ReportService {
return &ReportService{
Log: log,
Config: config2,
Tracer: tracer,
Monitoring: monitoring2,
PprofEndpoint: pprofHTTP,
AutoMaxPro: autoMaxProcsOption,
}
}