Skip to content
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

Local proxy documentation out of date #912

Open
yiakwy opened this issue Mar 22, 2019 · 6 comments
Open

Local proxy documentation out of date #912

yiakwy opened this issue Mar 22, 2019 · 6 comments

Comments

@yiakwy
Copy link

yiakwy commented Mar 22, 2019

There is no examples/main.go in examples

...
server/main.go: service implementation
main.go: entrypoint of the generated reverse proxy
...

Init dependencies failed

➜ examples git:(master) dep init
init failed: unable to determine direct dependencies: unable to deduce repository and source type for "golang.org/x/net/context": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://golang.org/x/net/context?go-get=1": Get http://golang.org/x/net/context?go-get=1: dial tcp 216.239.37.1:80: i/o timeout

@johanbrandhorst
Copy link
Collaborator

The dependency error is not within our control unfortunately (though maybe we could remove references to the old context import path).

I'm not sure about the out of date examples, where did you get that quoted text from? Would you be interested in contributing some better examples?

@yiakwy
Copy link
Author

yiakwy commented Mar 22, 2019

Hi @johanbrandhorst , the quoted text is from README residing in the master branch that the section of examples below the last step to set up a reverse proxy server.

The code isnot there but in other branches, e.g. the branch tagged by v0.1.0.

I just find that the dependencies problem comes from my network. I set up an http/https proxy and export the them in the terminal I am working on. It's gone.

I will be appreciated if anyone can help on how to resolve the package's dependencies outside
of $GOPATH because I am using it as a submodule in my CMake project (I prefer to compile proto files and move them a temporary directory named build for generated files so that they will be supervised under make system) built form grpc-c++l

I am newbie to go and was struggling to resolve this problem to run our grpc-gateway but got nothing: golang/go#31004

Thank you in advance.

@johanbrandhorst
Copy link
Collaborator

Glad to hear the download problem is gone. As for the dependency problem, I'm not sure this is the best forum to help you debug it, could you perhaps join the #grpc-gateway channel on gophers slack instead? This will be a problem with your setup and will require a lot of back and forth, so chatting is better and hopefully someone in there can help you.

I'm gonna leave this issue open to track any inaccuracies in our documentation regarding running the grpc-gateway. Could you perhaps point out the exact files to help someone fix it?

@johanbrandhorst johanbrandhorst changed the title [Documentation out of date] miss key files and fail to resolve dependencies Local proxy documentation out of date Mar 22, 2019
@yiakwy
Copy link
Author

yiakwy commented Mar 24, 2019

@johanbrandhorst Thanks for your help. The inconsistency lies in https://github.com/grpc-ecosystem/grpc-gateway/blob/master/README.md from master branch

## More Examples
More examples are available under `examples` directory.
* `proto/examplepb/echo_service.proto`, `proto/examplepb/a_bit_of_everything.proto`, `proto/examplepb/unannotated_echo_service.proto`: service definition
  * `proto/examplepb/echo_service.pb.go`, `proto/examplepb/a_bit_of_everything.pb.go`, `proto/examplepb/unannotated_echo_service.pb.go`: [generated] stub of the service
  * `proto/examplepb/echo_service.pb.gw.go`, `proto/examplepb/a_bit_of_everything.pb.gw.go`, `proto/examplepb/uannotated_echo_service.pb.gw.go`: [generated] reverse proxy for the service
  * `proto/examplepb/unannotated_echo_service.yaml`: gRPC API Configuration for ```unannotated_echo_service.proto```
* `server/main.go`: service implementation
* `main.go`: entrypoint of the generated reverse proxy

To use the same port for custom HTTP handlers (e.g. serving `swagger.json`),
gRPC-gateway, and a gRPC server, see
[this code example by CoreOS](https://github.com/philips/grpc-gateway-example/blob/master/cmd/serve.go)
(and its accompanying [blog post](https://coreos.com/blog/gRPC-protobufs-swagger.html)).

And I checked that in the branch tagged v1.0.0, the example folder contains main.go as entry file instead of what we have in examples/cmds. We use gulp to run those commands now.

I have joined in Gopher and am exploring grpc-ecosystem source codes in a deeper manner.

@johanbrandhorst
Copy link
Collaborator

Thanks a lot, that's a great starting point for a contribution to fix the docs issues!

@yiakwy
Copy link
Author

yiakwy commented Mar 28, 2019

Just updated the document. See PR #914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants