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

Add golang client, server and dart client support #594

Closed
vetcher opened this issue Jan 11, 2021 · 3 comments
Closed

Add golang client, server and dart client support #594

vetcher opened this issue Jan 11, 2021 · 3 comments
Labels
enhancement New feature or request stale

Comments

@vetcher
Copy link

vetcher commented Jan 11, 2021

I'm in search for service schema definitions and considering to choose your ecosystem openrpc. My stack is golang backend with microservices (so go <-> go interaction important too) and flutter mobile apps. Right now this tool supports only ts and rust as I can see.

Could you help me understand:

  1. How can I help you add go client, go server and dart client templates? I'm already have all generators based on https://github.com/semrush/zenrpc and SMD schema, but I dont know ts nor js at all.
  2. Why I need to install node.js and keep it as a dependency for my project?
    I propose to create separate repos for each language, like it does in OpenAPI (aka swagger) or Graphql ecosystems and write generator for each on their own languages. So it would be easier for me to help add more languages.
    OR allow to feed templates to your tool on fly (at execution time), protoc and protoc-gen-* (grpc-ecosystem) service generators works exactly like that (https://github.com/grpc-ecosystem/grpc-gateway) and distribute core generator in binary form.
@shanejonas
Copy link
Member

shanejonas commented Jan 11, 2021

@vetcher if you are using golang there is this library to generate the openrpc document from your code: https://github.com/etclabscore/go-openrpc-reflect

Also the advanced section of the webinar is all about go-openrpc-reflect and generating documents from code: https://open-rpc.org/webinar/

as for client generation, the language its written in is nodejs so you definitely need nodejs, dont think there will ever be a way to get away from that, just as swagger codegen requires Java. That being said, we do have plans to move each language to its own repo to be able to be composed within this repo, and be able to provide external templates like you mentioned.

Golang client support and flutter would definitely be good additions to the current generator.

As for binaries, I've played around with https://github.com/nexe/nexe but it produces quite a big binary since it has to include all of nodejs.

@shanejonas shanejonas added the enhancement New feature or request label Jan 11, 2021
@shanejonas shanejonas added this to To do in OpenRPC via automation Jan 11, 2021
@shanejonas shanejonas removed this from To do in OpenRPC Jan 11, 2021
@BelfordZ
Copy link
Member

BelfordZ commented Apr 16, 2021

@vetcher Work has been started to get golang clients done. We have the generated typings already, we just need to chose a client and get the template together. If there is someone wanting to put up funding to get that done, it will happen a lot faster :).

Passing in templates is an interesting pattern and something to consider, thank you.

@stale
Copy link

stale bot commented Jun 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 16, 2021
@stale stale bot closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants