Plugin to generate Client/Server stubs
Opened this issue · 3 comments
For example in Go it's possible to generate also all the client/server calls.
This avoids the tedious work of matching the request/response types, importing all Protos, etc.
I'm not sure exactly what you'd anticipate to be generated here. For example, if you take a look at https://github.com/well-typed/grapesy/blob/main/demo-client/Demo/Client/API/Protobuf/IO/RouteGuide.hs , which is the standard Protobuf RouteGuide example, there's barely any boilerplate required at all without generation. What did you have in mind?
I have a grpc with a few thousand rpc calls, so while I can manually add them, it would save time to just have req/resp calls generated.
Given a .proto
snippet:
...
service Service {
rpc ReqResource(Request) returns (Response) {
...
It would generate:
reqResource :: Client.CanCallRPC m => Request -> m Response
reqResource req = Client.nonStreaming (Client.rpc @(Client.Protobuf Service "reqResource") req
And other variants for streaming, etc.
Especially convenient when support for #85 is in.