5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/grpc_reflection/server.rb', line 5
def server_reflection_info(req, _unused_call)
request = req.first
res = Grpc::Reflection::V1::ServerReflectionResponse.new
if request.list_services.size != 0
res.list_services_response = Grpc::Reflection::V1::ListServiceResponse.new(service: list_services_response)
elsif !request.file_containing_symbol.empty?
result = GrpcReflection::FileDescriptorManager.select(request.file_containing_symbol)
res.file_descriptor_response = Grpc::Reflection::V1::FileDescriptorResponse.new(file_descriptor_proto: result)
end
[res].enum_for(:each)
end
|