-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[GSoD 2020] Added tutorials directory on gRPC-Gateway #1829
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.
Thanks for putting this together Rajiv. It's a bit of a mess right now, but I'm sure we can polish it into something useful for users. I propose the following overarching changes:
- Add a new introductory page that talks about what the grpc-gateway is, and what the goal of the tutorial is (build a basic gRPC server in Go with the gRPC-gateway proxying JSON/HTTP requests). Tell the user how to install
protoc-gen-go
andprotoc-gen-go-grpc
. Show the basic protofile that we're going to usehelloworld/hello_world.proto
. - Make another pass over
using_buf.md
andusing_protoc.md
, given the new introductory page (e.g. thebuf
document should talk about ahelloworld
protobuf root, theprotoc
generation commands must be relative to this root). Make both of these consistent around the core parts here: How to install the generator (buf/protoc) and how to generate the stubs once you've installed it. - Add a new page that introduces how we add the
http.proto
annotations to the existinghello_world.proto
, and how to install the grpc-gateway generators (only talk aboutprotoc-gen-grpc-gateway
, I don't think we need to talk about openapiv2 in this tutorial). This should also include how to modify yourprotoc
orbuf
generation workflows to generate grpc-gateway stubs. This also has to include copying the "vendored" protobuf files from the grpc-gateway repository into the protobuf file hierarchy (like the boilerplate repo has). - Finally, wrap up with a link to the boilerplate repo
main.go
that shows how to include the grpc-gateway in the Go server. Add thecurl
commands to this page and talk about what happens when the JSON hits the gateway.
How does that sound?
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.
Thanks for the first set of changes. I think it's starting to become a bit more clear what we need:
- The introductory page, which includes the prerequities. This is basically done (needs an intro).
- The page introducing
hello_world.proto
. - The buf/protoc generation sections. These are pretty good now but need to be updated to refer to hello_world.proto
- The Go
main.go
for a basic gRPC server. - The page adding the http annotations, copying the grpc-gateway proto files and updating the generation step to include the grpc-gateway generator.
- Finally a page talking about how to update
main.go
and the section on how to test that it is working. - The last page is the "Learn more" page we already have, we may end up tweaking it a little bit more towards the end but it's pretty good as it is.
How does that sound?
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.
Getting closer 😄. Something I feel is still missing is a consistency in these pages. When I make suggestions, they are broad suggestions, not to be followed with literally no adjustment. Please go over each page after you make the changes and use your personal judgement to make sure the content on the page makes sense. I want you to be writing this, not me, I am just here to guide towards the final product that we maintainers want to see. Thanks!
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.
Getting very close now!
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.
Almost there, next round this should be ready to merge!
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.
Alright, let's get this tutorial merged!
Added tutorials directory on gRPC-Gateway.