forked from TrueCloudLab/frostfs-node
[#328] container/grpc: Implement AnnounceUsedSpace method
Add AnnounceUsedSpace method that converts gRPC request to v2 request and passes it to v2 client. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>support/v0.27
parent
8419294f22
commit
7e586aef90
|
@ -85,3 +85,14 @@ func (s *Server) GetExtendedACL(ctx context.Context, req *containerGRPC.GetExten
|
|||
|
||||
return container.GetExtendedACLResponseToGRPCMessage(resp), nil
|
||||
}
|
||||
|
||||
// AnnounceUsedSpace converts gRPC AnnounceUsedSpaceRequest message and passes it to internal Container service.
|
||||
func (s *Server) AnnounceUsedSpace(ctx context.Context, req *containerGRPC.AnnounceUsedSpaceRequest) (*containerGRPC.AnnounceUsedSpaceResponse, error) {
|
||||
resp, err := s.srv.AnnounceUsedSpace(ctx, container.AnnounceUsedSpaceRequestFromGRPCMessage(req))
|
||||
if err != nil {
|
||||
// TODO: think about how we transport errors through gRPC
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return container.AnnounceUsedSpaceResponseToGRPCMessage(resp), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue