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
Add server-reflection-tutorial.md #937
Conversation
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.
Looks mostly good, just a couple of minor comments to signify the walkthrough. Thanks for doing this.
### Enable server reflection in gRPC-go servers | ||
|
||
gRPC-go Server Reflection is implemented in package [reflection](https://github.com/grpc/grpc-go/tree/master/reflection). To enable server reflection, you need to import this package and register reflection service on your gRPC server. | ||
|
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.
Instead of the hypothetical example below, do you want to state that this example walks through how server reflection can be enabled on the hello world example?
We can then use real code such as
pb.RegisterGreeterServer(s, &server{})
instead of the functions below.
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.
I changed it to the diff I made in helloworld example.
After enabling Server Reflection in a server application, you can use gRPC CLI | ||
to test its services. We don't have a gRPC CLI implemented in go, the only available CLI is in c++. | ||
|
||
Here we use `examples/helloworld` as an example to show the use of gRPC |
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.
We can move this statement up.
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.
Done.
7cc01ea
to
12b663c
Compare
Thanks for the review. All fixed. PTAL. |
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.
L(really)GTM!
12b663c
to
522de0d
Compare
gRPC Server Reflection provides information about publicly-accessible gRPC | ||
services on a server, and assists clients at runtime to construct RPC | ||
requests and responses without precompiled service information. It is used by | ||
gRPC CLI, which can be used to introspect server protos and send/receive test |
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.
add a link to CLI
|
||
gRPC-go Server Reflection is implemented in package [reflection](https://github.com/grpc/grpc-go/tree/master/reflection). To enable server reflection, you need to import this package and register reflection service on your gRPC server. | ||
|
||
For example, to enable server reflection in `example/helloworld`, the change needed is: |
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.
s/the change needed is/we need to make the following changes/
## Test services using Server Reflection | ||
|
||
After enabling Server Reflection in a server application, you can use gRPC CLI | ||
to test its services. We don't have a gRPC CLI implemented in go, the only available CLI is in c++. |
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.
s/test/check
the last sentence should be replaced by
"gRPC CLI is only available in C++."
then give a link including the corresponding instructions on installation and execution (are there?).
|
||
Instructions on how to use gRPC CLI can be found at | ||
[command_line_tool.md](https://github.com/grpc/grpc/blob/master/doc/command_line_tool.md), or using `grpc_cli help` command. | ||
|
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.
ok, move the above to the place I suggested.
|
||
```sh | ||
$ go run examples/helloworld/greeter_server/main.go | ||
``` |
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.
from 48 to 55, it should be
Run a hello world server
$ go run examples/helloworld/greeter_server/main.go
other things are not needed.
d82fe95
to
b1efb1e
Compare
No description provided.