diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-18 11:36:35 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-19 09:44:30 +0300 |
commit | 04d42dd6e30f0a1638445df9a3f2eb85e75171ee (patch) | |
tree | 294da5371c48341e0eeaad02a729d87b03d981d7 /internal/gitaly/service/namespace/server.go | |
parent | c0fae08db4a3d19a86d899ae94296e022ab0ac26 (diff) |
service: Simplify injection of dependencies for Namespace server
While we already have a `service.Dependencies` type around for quite a
long time, we still pass in dependencies explicitly when constructing
the actual server. This makes it harder than necessary to make a server
require more dependencies as you will have to adjust all callsites where
the server is currently getting constructed.
Simplify the code to instead inject the `service.Dependencies` type into
the server directly. This will allow us to propagate dependencies more
readily in the future.
Diffstat (limited to 'internal/gitaly/service/namespace/server.go')
-rw-r--r-- | internal/gitaly/service/namespace/server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/gitaly/service/namespace/server.go b/internal/gitaly/service/namespace/server.go index b0c31d6e6..1c2a2df68 100644 --- a/internal/gitaly/service/namespace/server.go +++ b/internal/gitaly/service/namespace/server.go @@ -1,6 +1,7 @@ package namespace import ( + "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage" "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb" ) @@ -11,6 +12,6 @@ type server struct { } // NewServer creates a new instance of a gRPC namespace server -func NewServer(locator storage.Locator) gitalypb.NamespaceServiceServer { - return &server{locator: locator} +func NewServer(deps *service.Dependencies) gitalypb.NamespaceServiceServer { + return &server{locator: deps.GetLocator()} } |