forked from TrueCloudLab/frostfs-node
[#398] cmd/node: Serve NetmapService.NetworkInfo RPC
Implement `NetworkInfo` calls on full stack of Netmap services. Current epoch is read from node local state, magic number is read via `MagicNumber` call of morph client. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
4c8d29ce46
commit
9073e198b9
7 changed files with 107 additions and 13 deletions
|
@ -35,3 +35,16 @@ func (s *responseService) LocalNodeInfo(ctx context.Context, req *netmap.LocalNo
|
|||
|
||||
return resp.(*netmap.LocalNodeInfoResponse), nil
|
||||
}
|
||||
|
||||
func (s *responseService) NetworkInfo(ctx context.Context, req *netmap.NetworkInfoRequest) (*netmap.NetworkInfoResponse, error) {
|
||||
resp, err := s.respSvc.HandleUnaryRequest(ctx, req,
|
||||
func(ctx context.Context, req interface{}) (util.ResponseMessage, error) {
|
||||
return s.svc.NetworkInfo(ctx, req.(*netmap.NetworkInfoRequest))
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp.(*netmap.NetworkInfoResponse), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue