[#83] cmd/neofs-node: Use response services in application

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-10-22 14:07:06 +03:00 committed by Alex Vanin
parent 0341773318
commit 3065a7363b
6 changed files with 43 additions and 24 deletions

View file

@ -33,9 +33,12 @@ func initAccountingService(c *cfg) {
accountingTransportGRPC.New( accountingTransportGRPC.New(
accountingService.NewSignService( accountingService.NewSignService(
c.key, c.key,
accountingService.NewExecutionService( accountingService.NewResponseService(
accounting.NewExecutor(balanceMorphWrapper), accountingService.NewExecutionService(
new(session.ResponseMetaHeader), accounting.NewExecutor(balanceMorphWrapper),
new(session.ResponseMetaHeader),
),
c.respSvc,
), ),
), ),
), ),

View file

@ -24,6 +24,7 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/event" "github.com/nspcc-dev/neofs-node/pkg/morph/event"
"github.com/nspcc-dev/neofs-node/pkg/network" "github.com/nspcc-dev/neofs-node/pkg/network"
tokenStorage "github.com/nspcc-dev/neofs-node/pkg/services/session/storage" tokenStorage "github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
"github.com/nspcc-dev/neofs-node/pkg/services/util/response"
"github.com/nspcc-dev/neofs-node/pkg/util/logger" "github.com/nspcc-dev/neofs-node/pkg/util/logger"
"github.com/nspcc-dev/neofs-node/pkg/util/profiler" "github.com/nspcc-dev/neofs-node/pkg/util/profiler"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -124,6 +125,8 @@ type cfg struct {
profiler profiler.Profiler profiler profiler.Profiler
workers []worker workers []worker
respSvc *response.Service
} }
type cfgGRPC struct { type cfgGRPC struct {
@ -257,6 +260,7 @@ func initCfg(path string) *cfg {
enableReflectService: viperCfg.GetBool(cfgReflectService), enableReflectService: viperCfg.GetBool(cfgReflectService),
}, },
localAddr: netAddr, localAddr: netAddr,
respSvc: response.NewService(),
} }
initLocalStorage(c) initLocalStorage(c)

View file

@ -32,9 +32,12 @@ func initContainerService(c *cfg) {
containerTransportGRPC.New( containerTransportGRPC.New(
containerService.NewSignService( containerService.NewSignService(
c.key, c.key,
containerService.NewExecutionService( containerService.NewResponseService(
containerMorph.NewExecutor(cnrClient), containerService.NewExecutionService(
new(session.ResponseMetaHeader), containerMorph.NewExecutor(cnrClient),
new(session.ResponseMetaHeader),
),
c.respSvc,
), ),
), ),
), ),

View file

@ -44,9 +44,12 @@ func initNetmapService(c *cfg) {
netmapTransportGRPC.New( netmapTransportGRPC.New(
netmapService.NewSignService( netmapService.NewSignService(
c.key, c.key,
netmapService.NewExecutionService( netmapService.NewResponseService(
c.cfgNodeInfo.info, netmapService.NewExecutionService(
c.apiVersion, c.cfgNodeInfo.info,
c.apiVersion,
),
c.respSvc,
), ),
), ),
), ),

View file

@ -333,18 +333,21 @@ func initObjectService(c *cfg) {
acl.WithNextService( acl.WithNextService(
objectService.NewSignService( objectService.NewSignService(
c.key, c.key,
objectService.NewTransportSplitter( objectService.NewResponseService(
c.cfgGRPC.maxChunkSize, objectService.NewTransportSplitter(
c.cfgGRPC.maxAddrAmount, c.cfgGRPC.maxChunkSize,
&objectSvc{ c.cfgGRPC.maxAddrAmount,
put: sPutV2, &objectSvc{
search: sSearchV2, put: sPutV2,
head: sHeadV2, search: sSearchV2,
rng: sRangeV2, head: sHeadV2,
get: sGetV2, rng: sRangeV2,
rngHash: sRangeHashV2, get: sGetV2,
delete: sDeleteV2, rngHash: sRangeHashV2,
}, delete: sDeleteV2,
},
),
c.respSvc,
), ),
), ),
), ),

View file

@ -15,9 +15,12 @@ func initSessionService(c *cfg) {
sessionTransportGRPC.New( sessionTransportGRPC.New(
sessionSvc.NewSignService( sessionSvc.NewSignService(
c.key, c.key,
sessionSvc.NewExecutionService( sessionSvc.NewResponseService(
c.privateTokenStore, sessionSvc.NewExecutionService(
new(session.ResponseMetaHeader), c.privateTokenStore,
new(session.ResponseMetaHeader),
),
c.respSvc,
), ),
), ),
), ),