forked from TrueCloudLab/frostfs-node
[#460] services/util: Remove HandleUnaryRequest
There is no need in a wrapper with many from-`interface{}` conversions. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
785d81a68a
commit
167a67f0b8
17 changed files with 76 additions and 339 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/util/response"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -17,14 +18,17 @@ type ServiceExecutor interface {
|
|||
type executorSvc struct {
|
||||
exec ServiceExecutor
|
||||
|
||||
respSvc *response.Service
|
||||
|
||||
log *logger.Logger
|
||||
}
|
||||
|
||||
// NewExecutionService wraps ServiceExecutor and returns Session Service interface.
|
||||
func NewExecutionService(exec ServiceExecutor, l *logger.Logger) Server {
|
||||
func NewExecutionService(exec ServiceExecutor, respSvc *response.Service, l *logger.Logger) Server {
|
||||
return &executorSvc{
|
||||
exec: exec,
|
||||
log: l,
|
||||
exec: exec,
|
||||
log: l,
|
||||
respSvc: respSvc,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,5 +46,6 @@ func (s *executorSvc) Create(ctx context.Context, req *session.CreateRequest) (*
|
|||
resp := new(session.CreateResponse)
|
||||
resp.SetBody(respBody)
|
||||
|
||||
s.respSvc.SetMeta(resp)
|
||||
return resp, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue