protobuild icon indicating copy to clipboard operation
protobuild copied to clipboard

Proposal to allow multiple service interface implementations for a single .proto

Open fraenkel opened this issue 5 years ago • 3 comments

Support generation of multiple service interface code implementations via different plugins from a single .proto. A user should be able to target a specific .proto and specify the plugin, and resulting import package location which provides the target directory for any generated code as well as the package name. It is the users responsibility to prevent collisions between the multiple plugins.

One use-case of this feature would be to generate ttrpc and grpc service implementations for a given .proto service defintiion.

An experiment was perfomed to see what could be possible with minimal modifications to Protobuild while leveraging the capabilities of protoc and the existing generators. By providing arguments for the import path, and output directory, protoc can be controlled to generate what is needed.

fraenkel avatar Aug 03 '18 02:08 fraenkel

Do you have details of the proposal? An example configuration file?

stevvooe avatar Sep 24 '18 17:09 stevvooe

@fraenkel Would these generate the ttrpc and grpc definitions to separate packages or the same package?

stevvooe avatar Jan 31 '20 00:01 stevvooe

Had to go track this down since its been a while. It started from https://github.com/containerd/containerd/pull/2475 and I have a branch, https://github.com/fraenkel/protobuild/tree/relative_outputs TBH, I don't know how far I got since it all went silent.

fraenkel avatar Feb 01 '20 12:02 fraenkel