[#891] getSvc: Refactor Get service V2 creation
All checks were successful
DCO action / DCO (pull_request) Successful in 2m46s
Vulncheck / Vulncheck (pull_request) Successful in 2m53s
Build / Build Components (1.20) (pull_request) Successful in 4m31s
Build / Build Components (1.21) (pull_request) Successful in 4m26s
Tests and linters / Lint (pull_request) Successful in 6m9s
Tests and linters / Staticcheck (pull_request) Successful in 6m7s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m27s
Tests and linters / Tests (1.21) (pull_request) Successful in 9m4s
Tests and linters / Tests with -race (pull_request) Successful in 9m48s

Use arguments for mandatory fields.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-01-12 10:05:29 +03:00
parent 394f086fe2
commit 52ffa9f164
3 changed files with 24 additions and 59 deletions

View file

@ -372,13 +372,12 @@ func createGetService(c *cfg, keyStorage *util.KeyStorage, traverseGen *util.Tra
func createGetServiceV2(c *cfg, sGet *getsvc.Service, keyStorage *util.KeyStorage) *getsvcV2.Service {
return getsvcV2.NewService(
getsvcV2.WithInternalService(sGet),
getsvcV2.WithKeyStorage(keyStorage),
getsvcV2.WithEpochSource(c.netMapSource),
getsvcV2.WithClientSource(c.clientCache),
getsvcV2.WithContainerSource(c.cfgObject.cnrSource),
getsvcV2.WithNetmapSource(c.netMapSource),
getsvcV2.WithNetmapAnnouncedKeys(c),
sGet,
keyStorage,
c.clientCache,
c.netMapSource,
c,
c.cfgObject.cnrSource,
getsvcV2.WithLogger(c.log),
)
}