[#83] services: Remove setting of meta header from executing services

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-10-22 14:12:35 +03:00 committed by Alex Vanin
parent 3065a7363b
commit 19f9c7eacb
7 changed files with 6 additions and 39 deletions

View file

@ -2,7 +2,6 @@ package main
import (
accountingGRPC "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc"
"github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/balance"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/balance/wrapper"
@ -36,7 +35,6 @@ func initAccountingService(c *cfg) {
accountingService.NewResponseService(
accountingService.NewExecutionService(
accounting.NewExecutor(balanceMorphWrapper),
new(session.ResponseMetaHeader),
),
c.respSvc,
),

View file

@ -2,7 +2,6 @@ package main
import (
containerGRPC "github.com/nspcc-dev/neofs-api-go/v2/container/grpc"
"github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper"
@ -35,7 +34,6 @@ func initContainerService(c *cfg) {
containerService.NewResponseService(
containerService.NewExecutionService(
containerMorph.NewExecutor(cnrClient),
new(session.ResponseMetaHeader),
),
c.respSvc,
),

View file

@ -1,7 +1,6 @@
package main
import (
"github.com/nspcc-dev/neofs-api-go/v2/session"
sessionGRPC "github.com/nspcc-dev/neofs-api-go/v2/session/grpc"
sessionTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/session/grpc"
sessionSvc "github.com/nspcc-dev/neofs-node/pkg/services/session"
@ -18,7 +17,6 @@ func initSessionService(c *cfg) {
sessionSvc.NewResponseService(
sessionSvc.NewExecutionService(
c.privateTokenStore,
new(session.ResponseMetaHeader),
),
c.respSvc,
),

View file

@ -4,7 +4,6 @@ import (
"context"
"github.com/nspcc-dev/neofs-api-go/v2/accounting"
"github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/pkg/errors"
)
@ -14,17 +13,12 @@ type ServiceExecutor interface {
type executorSvc struct {
exec ServiceExecutor
metaHeader *session.ResponseMetaHeader
}
// NewExecutionService wraps ServiceExecutor and returns Accounting Service interface.
//
// Passed meta header is attached to all responses.
func NewExecutionService(exec ServiceExecutor, metaHdr *session.ResponseMetaHeader) accounting.Service {
func NewExecutionService(exec ServiceExecutor) accounting.Service {
return &executorSvc{
exec: exec,
metaHeader: metaHdr,
exec: exec,
}
}
@ -36,7 +30,6 @@ func (s *executorSvc) Balance(ctx context.Context, req *accounting.BalanceReques
resp := new(accounting.BalanceResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}

View file

@ -4,7 +4,6 @@ import (
"context"
"github.com/nspcc-dev/neofs-api-go/v2/container"
"github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/pkg/errors"
)
@ -19,17 +18,12 @@ type ServiceExecutor interface {
type executorSvc struct {
exec ServiceExecutor
metaHeader *session.ResponseMetaHeader
}
// NewExecutionService wraps ServiceExecutor and returns Container Service interface.
//
// Passed meta header is attached to all responses.
func NewExecutionService(exec ServiceExecutor, metaHdr *session.ResponseMetaHeader) container.Service {
func NewExecutionService(exec ServiceExecutor) container.Service {
return &executorSvc{
exec: exec,
metaHeader: metaHdr,
exec: exec,
}
}
@ -41,7 +35,6 @@ func (s *executorSvc) Put(ctx context.Context, req *container.PutRequest) (*cont
resp := new(container.PutResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}
@ -54,7 +47,6 @@ func (s *executorSvc) Delete(ctx context.Context, req *container.DeleteRequest)
resp := new(container.DeleteResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}
@ -67,7 +59,6 @@ func (s *executorSvc) Get(ctx context.Context, req *container.GetRequest) (*cont
resp := new(container.GetResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}
@ -80,7 +71,6 @@ func (s *executorSvc) List(ctx context.Context, req *container.ListRequest) (*co
resp := new(container.ListResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}
@ -93,7 +83,6 @@ func (s *executorSvc) SetExtendedACL(ctx context.Context, req *container.SetExte
resp := new(container.SetExtendedACLResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}
@ -106,7 +95,6 @@ func (s *executorSvc) GetExtendedACL(ctx context.Context, req *container.GetExte
resp := new(container.GetExtendedACLResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}

View file

@ -5,7 +5,6 @@ import (
"github.com/nspcc-dev/neofs-api-go/pkg"
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
"github.com/nspcc-dev/neofs-api-go/v2/session"
)
type executorSvc struct {
@ -35,7 +34,6 @@ func (s *executorSvc) LocalNodeInfo(
resp := new(netmap.LocalNodeInfoResponse)
resp.SetBody(body)
resp.SetMetaHeader(new(session.ResponseMetaHeader))
return resp, nil
}

View file

@ -13,17 +13,12 @@ type ServiceExecutor interface {
type executorSvc struct {
exec ServiceExecutor
metaHeader *session.ResponseMetaHeader
}
// NewExecutionService wraps ServiceExecutor and returns Session Service interface.
//
// Passed meta header is attached to all responses.
func NewExecutionService(exec ServiceExecutor, metaHdr *session.ResponseMetaHeader) session.Service {
func NewExecutionService(exec ServiceExecutor) session.Service {
return &executorSvc{
exec: exec,
metaHeader: metaHdr,
exec: exec,
}
}
@ -35,7 +30,6 @@ func (s *executorSvc) Create(ctx context.Context, req *session.CreateRequest) (*
resp := new(session.CreateResponse)
resp.SetBody(respBody)
resp.SetMetaHeader(s.metaHeader)
return resp, nil
}