forked from TrueCloudLab/frostfs-node
[#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,10 +33,13 @@ func initAccountingService(c *cfg) {
|
||||||
accountingTransportGRPC.New(
|
accountingTransportGRPC.New(
|
||||||
accountingService.NewSignService(
|
accountingService.NewSignService(
|
||||||
c.key,
|
c.key,
|
||||||
|
accountingService.NewResponseService(
|
||||||
accountingService.NewExecutionService(
|
accountingService.NewExecutionService(
|
||||||
accounting.NewExecutor(balanceMorphWrapper),
|
accounting.NewExecutor(balanceMorphWrapper),
|
||||||
new(session.ResponseMetaHeader),
|
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/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)
|
||||||
|
|
|
@ -32,10 +32,13 @@ func initContainerService(c *cfg) {
|
||||||
containerTransportGRPC.New(
|
containerTransportGRPC.New(
|
||||||
containerService.NewSignService(
|
containerService.NewSignService(
|
||||||
c.key,
|
c.key,
|
||||||
|
containerService.NewResponseService(
|
||||||
containerService.NewExecutionService(
|
containerService.NewExecutionService(
|
||||||
containerMorph.NewExecutor(cnrClient),
|
containerMorph.NewExecutor(cnrClient),
|
||||||
new(session.ResponseMetaHeader),
|
new(session.ResponseMetaHeader),
|
||||||
),
|
),
|
||||||
|
c.respSvc,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -44,10 +44,13 @@ func initNetmapService(c *cfg) {
|
||||||
netmapTransportGRPC.New(
|
netmapTransportGRPC.New(
|
||||||
netmapService.NewSignService(
|
netmapService.NewSignService(
|
||||||
c.key,
|
c.key,
|
||||||
|
netmapService.NewResponseService(
|
||||||
netmapService.NewExecutionService(
|
netmapService.NewExecutionService(
|
||||||
c.cfgNodeInfo.info,
|
c.cfgNodeInfo.info,
|
||||||
c.apiVersion,
|
c.apiVersion,
|
||||||
),
|
),
|
||||||
|
c.respSvc,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -333,6 +333,7 @@ func initObjectService(c *cfg) {
|
||||||
acl.WithNextService(
|
acl.WithNextService(
|
||||||
objectService.NewSignService(
|
objectService.NewSignService(
|
||||||
c.key,
|
c.key,
|
||||||
|
objectService.NewResponseService(
|
||||||
objectService.NewTransportSplitter(
|
objectService.NewTransportSplitter(
|
||||||
c.cfgGRPC.maxChunkSize,
|
c.cfgGRPC.maxChunkSize,
|
||||||
c.cfgGRPC.maxAddrAmount,
|
c.cfgGRPC.maxAddrAmount,
|
||||||
|
@ -346,6 +347,8 @@ func initObjectService(c *cfg) {
|
||||||
delete: sDeleteV2,
|
delete: sDeleteV2,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
c.respSvc,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
acl.WithLocalStorage(ls),
|
acl.WithLocalStorage(ls),
|
||||||
|
|
|
@ -15,10 +15,13 @@ func initSessionService(c *cfg) {
|
||||||
sessionTransportGRPC.New(
|
sessionTransportGRPC.New(
|
||||||
sessionSvc.NewSignService(
|
sessionSvc.NewSignService(
|
||||||
c.key,
|
c.key,
|
||||||
|
sessionSvc.NewResponseService(
|
||||||
sessionSvc.NewExecutionService(
|
sessionSvc.NewExecutionService(
|
||||||
c.privateTokenStore,
|
c.privateTokenStore,
|
||||||
new(session.ResponseMetaHeader),
|
new(session.ResponseMetaHeader),
|
||||||
),
|
),
|
||||||
|
c.respSvc,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue