cloudstate icon indicating copy to clipboard operation
cloudstate copied to clipboard

Protoc plugin to generate stub for specified language from gRPC descriptor

Open michaelpnash opened this issue 5 years ago • 4 comments
trafficstars

A suggestion for a plugin for protoc compiler which generates a stub for a given language support from a gRPC descriptor

michaelpnash avatar May 24 '20 01:05 michaelpnash

This would be helpful also for languages where the generated protobuf artefacts are not fully complete; like the one for Go where service descriptors are not exported to user code. In this case, service names and methods are not available in a typesafe manner. Even the new protocolbuffer support for Go does not support that: ServiceName and Method names are private.

marcellanz avatar Jun 09 '20 16:06 marcellanz

How would it be? I believe that there should be several plugins, one for each support language and maybe this is a hard job. It would be welcome of course, but I think a simpler way is to get tools like Cloudstate Community CLI or lbcs CLI to do that. Because I think that in this case it would just be compiling the proto files for each language with some code generators on top. Just thinking....

sleipnir avatar Jun 09 '20 17:06 sleipnir

I think what his issue describes is a generic plugin to scaffold anything between a gRPC protobuf file and what the user has to implement just before he can start to write his business code. Even if hard to implement, it has to be done only once. The Cloudstate Community CLI would benefit of that too I think.

… I should add that personally I'm not that of a fan of scaffolding tools most of the time. But if it helps to get started, why not :)

marcellanz avatar Jun 09 '20 17:06 marcellanz

I am thinking about the implementation and I don't see how a generic plugin could be in the protoc. But any wide entryway helps

sleipnir avatar Jun 09 '20 18:06 sleipnir