Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-24 Thread Ivan Vučica
Cool, that's exactly the stuff I was interested in. (I was actually trying to figure out why implementing "grpc-web" is not a trivial problem. :)) On Thu, Feb 23, 2017 at 12:33 PM, Axel Wagner wrote: > From what I know, a) with the normal protobuf package, you

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-23 Thread 'Axel Wagner' via golang-nuts
>From what I know, a) with the normal protobuf package, you can not en- or decode and then reflect messages by the proto descriptor, you need to compile in the generated code - adding methods to a reflect-created struct alone doesn't help, as the package also has some assumptions about the

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-23 Thread Ivan Vučica
What I want, in the end, is to send a gRPC request based on an ASCII or JSON representation of a protobuf, receive a response and display it. Essentially, if you take grpc_cli tool present in the repo of C implementation of gRPC, I would like to implement its "call" functionality. Even though

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-22 Thread Matt Harden
Is the intermediate Go struct necessary, or do you just want to convert a text proto to a binary representation? On Wed, Feb 22, 2017 at 6:10 PM wrote: > Hi, > > I'm fiddling with gRPC and its service reflection. I discovered a neat > package (github.com/jhump/protoreflect)

[go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-22 Thread ivucica
Hi, I'm fiddling with gRPC and its service reflection. I discovered a neat package (github.com/jhump/protoreflect) that let me quickly enumerate the services that are exposed by the gRPC server, the RPCs that are in those gRPC services, and finally the proto messages that are used as inputs