blob: 2852a9c6abcc3cdbaceca6a3032c1319de8a1b4e (
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
|
package ref
import (
"gitlab.com/gitlab-org/gitaly/v14/internal/git"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/catfile"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/localrepo"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/repository"
"gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v14/internal/gitaly/transaction"
"gitlab.com/gitlab-org/gitaly/v14/internal/storage"
"gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"
)
type server struct {
cfg config.Cfg
txManager transaction.Manager
locator storage.Locator
gitCmdFactory git.CommandFactory
catfileCache catfile.Cache
}
// NewServer creates a new instance of a grpc RefServer
func NewServer(
cfg config.Cfg,
locator storage.Locator,
gitCmdFactory git.CommandFactory,
txManager transaction.Manager,
catfileCache catfile.Cache,
) gitalypb.RefServiceServer {
return &server{
cfg: cfg,
txManager: txManager,
locator: locator,
gitCmdFactory: gitCmdFactory,
catfileCache: catfileCache,
}
}
func (s *server) localrepo(repo repository.GitRepo) *localrepo.Repo {
return localrepo.New(s.gitCmdFactory, s.catfileCache, repo, s.cfg)
}
|