Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin to generate Client/Server stubs #80

Open
domenkozar opened this issue Feb 7, 2024 · 3 comments
Open

Plugin to generate Client/Server stubs #80

domenkozar opened this issue Feb 7, 2024 · 3 comments
Labels
enhancement New feature or request priority: low Minor enhancements

Comments

@domenkozar
Copy link

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.

@edsko
Copy link
Collaborator

edsko commented Feb 8, 2024

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?

@domenkozar
Copy link
Author

domenkozar commented Feb 8, 2024

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.

@edsko edsko added the enhancement New feature or request label Feb 8, 2024
@domenkozar
Copy link
Author

Especially convenient when support for #85 is in.

@edsko edsko added the priority: low Minor enhancements label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low Minor enhancements
Projects
None yet
Development

No branches or pull requests

2 participants