mirror of https://github.com/grpc/grpc-go.git
Implement ServerReflectionRequest_ListServices
This commit is contained in:
parent
efe8d5f0f7
commit
531771bfae
|
|
@ -280,10 +280,16 @@ func (s *serverReflectionServer) ServerReflectionInfo(stream rpb.ServerReflectio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *rpb.ServerReflectionRequest_ListServices:
|
case *rpb.ServerReflectionRequest_ListServices:
|
||||||
out.MessageResponse = &rpb.ServerReflectionResponse_ErrorResponse{
|
services := s.s.AllServiceNames()
|
||||||
ErrorResponse: &rpb.ErrorResponse{
|
serviceResponses := make([]*rpb.ServiceResponse, len(services))
|
||||||
ErrorCode: int32(codes.Unimplemented),
|
for i, s := range services {
|
||||||
ErrorMessage: "list_services not implemented",
|
serviceResponses[i] = &rpb.ServiceResponse{
|
||||||
|
Name: s,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out.MessageResponse = &rpb.ServerReflectionResponse_ListServicesResponse{
|
||||||
|
ListServicesResponse: &rpb.ListServiceResponse{
|
||||||
|
Service: serviceResponses,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue