blob: d0f568af328a99b401d03cb4e32f035a5ee7d50d (
plain)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
package service
import (
"gitlab.com/gitlab-org/gitaly/v16/client"
"gitlab.com/gitlab-org/gitaly/v16/internal/backup"
"gitlab.com/gitlab-org/gitaly/v16/internal/cache"
"gitlab.com/gitlab-org/gitaly/v16/internal/git"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/catfile"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/housekeeping"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
gitalyhook "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/hook"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/hook/updateref"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage/counter"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage/storagemgr"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitlab"
"gitlab.com/gitlab-org/gitaly/v16/internal/grpc/backchannel"
"gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/limithandler"
"gitlab.com/gitlab-org/gitaly/v16/internal/limiter"
"gitlab.com/gitlab-org/gitaly/v16/internal/streamcache"
)
// Dependencies assembles set of components required by different kinds of services.
type Dependencies struct {
Cfg config.Cfg
GitalyHookManager gitalyhook.Manager
TransactionManager transaction.Manager
StorageLocator storage.Locator
ClientPool *client.Pool
GitCmdFactory git.CommandFactory
BackchannelRegistry *backchannel.Registry
GitlabClient gitlab.Client
CatfileCache catfile.Cache
DiskCache cache.Cache
PackObjectsCache streamcache.Cache
PackObjectsLimiter limiter.Limiter
LimitHandler *limithandler.LimiterMiddleware
RepositoryCounter *counter.RepositoryCounter
UpdaterWithHooks *updateref.UpdaterWithHooks
HousekeepingManager housekeeping.Manager
PartitionManager *storagemgr.PartitionManager
BackupSink backup.Sink
BackupLocator backup.Locator
}
// GetCfg returns service configuration.
func (dc *Dependencies) GetCfg() config.Cfg {
return dc.Cfg
}
// GetHookManager returns hook manager.
func (dc *Dependencies) GetHookManager() gitalyhook.Manager {
return dc.GitalyHookManager
}
// GetTxManager returns transaction manager.
func (dc *Dependencies) GetTxManager() transaction.Manager {
return dc.TransactionManager
}
// GetLocator returns storage locator.
func (dc *Dependencies) GetLocator() storage.Locator {
return dc.StorageLocator
}
// GetConnsPool returns gRPC connection pool.
func (dc *Dependencies) GetConnsPool() *client.Pool {
return dc.ClientPool
}
// GetGitCmdFactory returns git commands factory.
func (dc *Dependencies) GetGitCmdFactory() git.CommandFactory {
return dc.GitCmdFactory
}
// GetBackchannelRegistry returns a registry of the backchannels.
func (dc *Dependencies) GetBackchannelRegistry() *backchannel.Registry {
return dc.BackchannelRegistry
}
// GetGitlabClient returns client to access GitLab API.
func (dc *Dependencies) GetGitlabClient() gitlab.Client {
return dc.GitlabClient
}
// GetCatfileCache returns catfile cache.
func (dc *Dependencies) GetCatfileCache() catfile.Cache {
return dc.CatfileCache
}
// GetDiskCache returns the disk cache.
func (dc *Dependencies) GetDiskCache() cache.Cache {
return dc.DiskCache
}
// GetPackObjectsCache returns the pack-objects cache.
func (dc *Dependencies) GetPackObjectsCache() streamcache.Cache {
return dc.PackObjectsCache
}
// GetLimitHandler returns the RPC limit handler.
func (dc *Dependencies) GetLimitHandler() *limithandler.LimiterMiddleware {
return dc.LimitHandler
}
// GetRepositoryCounter returns the repository counter.
func (dc *Dependencies) GetRepositoryCounter() *counter.RepositoryCounter {
return dc.RepositoryCounter
}
// GetUpdaterWithHooks returns the updater with hooks executor.
func (dc *Dependencies) GetUpdaterWithHooks() *updateref.UpdaterWithHooks {
return dc.UpdaterWithHooks
}
// GetHousekeepingManager returns the housekeeping manager.
func (dc *Dependencies) GetHousekeepingManager() housekeeping.Manager {
return dc.HousekeepingManager
}
// GetPackObjectsLimiter returns the pack-objects limiter.
func (dc *Dependencies) GetPackObjectsLimiter() limiter.Limiter {
return dc.PackObjectsLimiter
}
// GetPartitionManager returns the PartitionManager.
func (dc *Dependencies) GetPartitionManager() *storagemgr.PartitionManager {
return dc.PartitionManager
}
// GetBackupSink returns the backup.Sink.
func (dc *Dependencies) GetBackupSink() backup.Sink {
return dc.BackupSink
}
// GetBackupLocator returns the backup.Locator.
func (dc *Dependencies) GetBackupLocator() backup.Locator {
return dc.BackupLocator
}
|