-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflection integration #192
Conversation
src/Grpc.AspNetCore.Server/GrpcEndpointRouteBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
examples/Server/Startup.cs
Outdated
@@ -40,6 +41,7 @@ public void Configure(IApplicationBuilder app) | |||
routes.MapGrpcService<MailerService>(); | |||
routes.MapGrpcService<CounterService>(); | |||
routes.MapGrpcService<GreeterService>(); | |||
routes.MapGrpcReflectionService(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding reflection on the server:
services.AddGrpcReflection();
plus
services.MapGrpcReflectionService();
Clean! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! LGTM after addressing comments.
src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj
Outdated
Show resolved
Hide resolved
src/Grpc.AspNetCore.Server/GrpcEndpointRouteBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
8334d80
to
2740d80
Compare
703adad
to
bb5140b
Compare
I've rewritten this slightly to use endpoints + metadata to get the services instead of a new registry. |
@JunTaoLuo ping. Review please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
test/Grpc.AspNetCore.Server.Tests/Grpc.AspNetCore.Server.Tests.csproj
Outdated
Show resolved
Hide resolved
src/Grpc.AspNetCore.Server.Reflection/GrpcReflectionServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Grpc.AspNetCore.Server.Reflection/GrpcEndpointRouteBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Grpc.AspNetCore.Server.Reflection/Internal/ReflectionGrpcServiceActivator.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments. Also, will there be tests added?
I'll add a couple of tests, just to sanity check that it still works. |
Introduces Grpc.AspNetCore.Server.Reflection. It provides a reflection integration with gRPC for ASP.NET.
It is a separate package because it depends on Grpc.Reflection, and Grpc.Reflection has a dependency on Grpc.Core. If we want to avoid an extra package then we could re-implement the server component of Grpc.Reflection, eliminate the dependency and build everything into Grpc.AspNetCore.Server.
Done now to figure out how to access the service descriptor using reflection for grpc/grpc#18484