[#486] node: Add PutSingle wrappers

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-07-03 11:36:20 +03:00
parent 9be5d44a46
commit 7b76527759
11 changed files with 148 additions and 3 deletions

View file

@ -120,6 +120,22 @@ func (s *SignService) Head(ctx context.Context, req *object.HeadRequest) (*objec
return resp.(*object.HeadResponse), nil
}
func (s *SignService) PutSingle(ctx context.Context, req *object.PutSingleRequest) (*object.PutSingleResponse, error) {
resp, err := s.sigSvc.HandleUnaryRequest(ctx, req,
func(ctx context.Context, req any) (util.ResponseMessage, error) {
return s.svc.PutSingle(ctx, req.(*object.PutSingleRequest))
},
func() util.ResponseMessage {
return new(object.PutSingleResponse)
},
)
if err != nil {
return nil, err
}
return resp.(*object.PutSingleResponse), nil
}
func (s *searchStreamSigner) Send(resp *object.SearchResponse) error {
s.nonEmptyResp = true
return s.respWriter(resp)