blob: acbfd2f965605f7a2caada437509dad76dfedc94 (
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
|
$:.unshift(File.expand_path('../proto', __dir__))
require 'gitaly'
require_relative 'gitlab/git.rb'
require_relative 'gitaly_server/client.rb'
require_relative 'gitaly_server/utils.rb'
require_relative 'gitaly_server/blob_service.rb'
require_relative 'gitaly_server/ref_service.rb'
require_relative 'gitaly_server/operations_service.rb'
require_relative 'gitaly_server/repository_service.rb'
require_relative 'gitaly_server/wiki_service.rb'
require_relative 'gitaly_server/conflicts_service.rb'
require_relative 'gitaly_server/remote_service.rb'
require_relative 'gitaly_server/health_service.rb'
require_relative 'gitaly_server/feature_flags.rb'
module GitalyServer
STORAGE_PATH_HEADER = 'gitaly-storage-path'.freeze
REPO_PATH_HEADER = 'gitaly-repo-path'.freeze
GL_REPOSITORY_HEADER = 'gitaly-gl-repository'.freeze
REPO_ALT_DIRS_HEADER = 'gitaly-repo-alt-dirs'.freeze
GITALY_SERVERS_HEADER = 'gitaly-servers'.freeze
def self.storage_path(call)
call.metadata.fetch(STORAGE_PATH_HEADER)
end
def self.repo_path(call)
call.metadata.fetch(REPO_PATH_HEADER)
end
def self.gl_repository(call)
call.metadata.fetch(GL_REPOSITORY_HEADER)
end
def self.repo_alt_dirs(call)
call.metadata.fetch(REPO_ALT_DIRS_HEADER)
end
def self.feature_flags(call)
FeatureFlags.new(call.metadata)
end
def self.client(call)
Client.new(call.metadata[GITALY_SERVERS_HEADER])
end
def self.register_handlers(server)
server.handle(RefService.new)
server.handle(OperationsService.new)
server.handle(RepositoryService.new)
server.handle(WikiService.new)
server.handle(ConflictsService.new)
server.handle(RemoteService.new)
server.handle(BlobService.new)
server.handle(HealthService.new)
end
end
|