grpc-gateway sample code seems incorrect

69 views
Skip to first unread message

emmulator

unread,
Oct 25, 2016, 1:21:25 PM10/25/16
to grpc.io
I'm following the instructions at https://github.com/grpc-ecosystem/grpc-gateway, and the "Write an entrypoint" says to call a method like this:

 err := gw.Register[YourServiceHandler]FromEndpoint(ctx, mux, *echoEndpoint, opts)

But the generated service doesn't have any such method, nor anything that takes that set of parameters.  I'm using a slightly modified hello_world.proto from the distro, and the only register method in hello_world.pb.go is

 func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) 

I have the equivalent of *echoEndpoint in the original example to pass to *grpc.Server, but what should I pass as the second param?  

Or what am I missing or doing wrong?

Thanks!

jjus...@sensus-communis.com

unread,
Oct 25, 2016, 5:13:09 PM10/25/16
to grpc.io, jjus...@sensus-communis.com


On Tuesday, October 25, 2016 at 10:21:25 AM UTC-7, emmulator wrote:
I'm following the instructions at https://github.com/grpc-ecosystem/grpc-gateway, and the "Write an entrypoint" says to call a method like this:



Ok, sorry.  Clearly I wasn't following the instructions very well.  Or maybe it would be better to switch steps 4 and 5 -- I saw 4 was "optional" and since I already have a server, I skipped it, but somehow wound up on 6 instead of 5, so I never actually generated the proxy, only the stub.

My bad. 
Reply all
Reply to author
Forward
0 new messages