[#83] cmd/neofs-node: Use response services in application
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0341773318
commit
3065a7363b
6 changed files with 43 additions and 24 deletions
|
@ -33,9 +33,12 @@ func initAccountingService(c *cfg) {
|
|||
accountingTransportGRPC.New(
|
||||
accountingService.NewSignService(
|
||||
c.key,
|
||||
accountingService.NewExecutionService(
|
||||
accounting.NewExecutor(balanceMorphWrapper),
|
||||
new(session.ResponseMetaHeader),
|
||||
accountingService.NewResponseService(
|
||||
accountingService.NewExecutionService(
|
||||
accounting.NewExecutor(balanceMorphWrapper),
|
||||
new(session.ResponseMetaHeader),
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
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/profiler"
|
||||
"github.com/pkg/errors"
|
||||
|
@ -124,6 +125,8 @@ type cfg struct {
|
|||
profiler profiler.Profiler
|
||||
|
||||
workers []worker
|
||||
|
||||
respSvc *response.Service
|
||||
}
|
||||
|
||||
type cfgGRPC struct {
|
||||
|
@ -257,6 +260,7 @@ func initCfg(path string) *cfg {
|
|||
enableReflectService: viperCfg.GetBool(cfgReflectService),
|
||||
},
|
||||
localAddr: netAddr,
|
||||
respSvc: response.NewService(),
|
||||
}
|
||||
|
||||
initLocalStorage(c)
|
||||
|
|
|
@ -32,9 +32,12 @@ func initContainerService(c *cfg) {
|
|||
containerTransportGRPC.New(
|
||||
containerService.NewSignService(
|
||||
c.key,
|
||||
containerService.NewExecutionService(
|
||||
containerMorph.NewExecutor(cnrClient),
|
||||
new(session.ResponseMetaHeader),
|
||||
containerService.NewResponseService(
|
||||
containerService.NewExecutionService(
|
||||
containerMorph.NewExecutor(cnrClient),
|
||||
new(session.ResponseMetaHeader),
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -44,9 +44,12 @@ func initNetmapService(c *cfg) {
|
|||
netmapTransportGRPC.New(
|
||||
netmapService.NewSignService(
|
||||
c.key,
|
||||
netmapService.NewExecutionService(
|
||||
c.cfgNodeInfo.info,
|
||||
c.apiVersion,
|
||||
netmapService.NewResponseService(
|
||||
netmapService.NewExecutionService(
|
||||
c.cfgNodeInfo.info,
|
||||
c.apiVersion,
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -333,18 +333,21 @@ func initObjectService(c *cfg) {
|
|||
acl.WithNextService(
|
||||
objectService.NewSignService(
|
||||
c.key,
|
||||
objectService.NewTransportSplitter(
|
||||
c.cfgGRPC.maxChunkSize,
|
||||
c.cfgGRPC.maxAddrAmount,
|
||||
&objectSvc{
|
||||
put: sPutV2,
|
||||
search: sSearchV2,
|
||||
head: sHeadV2,
|
||||
rng: sRangeV2,
|
||||
get: sGetV2,
|
||||
rngHash: sRangeHashV2,
|
||||
delete: sDeleteV2,
|
||||
},
|
||||
objectService.NewResponseService(
|
||||
objectService.NewTransportSplitter(
|
||||
c.cfgGRPC.maxChunkSize,
|
||||
c.cfgGRPC.maxAddrAmount,
|
||||
&objectSvc{
|
||||
put: sPutV2,
|
||||
search: sSearchV2,
|
||||
head: sHeadV2,
|
||||
rng: sRangeV2,
|
||||
get: sGetV2,
|
||||
rngHash: sRangeHashV2,
|
||||
delete: sDeleteV2,
|
||||
},
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -15,9 +15,12 @@ func initSessionService(c *cfg) {
|
|||
sessionTransportGRPC.New(
|
||||
sessionSvc.NewSignService(
|
||||
c.key,
|
||||
sessionSvc.NewExecutionService(
|
||||
c.privateTokenStore,
|
||||
new(session.ResponseMetaHeader),
|
||||
sessionSvc.NewResponseService(
|
||||
sessionSvc.NewExecutionService(
|
||||
c.privateTokenStore,
|
||||
new(session.ResponseMetaHeader),
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue