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

Support GRPC in Go #50

Closed
huan opened this issue Apr 13, 2020 · 3 comments
Closed

Support GRPC in Go #50

huan opened this issue Apr 13, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@huan
Copy link
Member

huan commented Apr 13, 2020

We are working on the Go Wechaty recently, so we will need to support the Go version of our GRPC stubs.

The generating part will be very similar to the TypeScript & Python version that we are already supported. see: @chatie/grpc@NPM & chatie-grpc@PyPI

However, there's a difference between the Go and TypeScript/Python: we need to store the generated Go stub source code in our repository, instead of published to a centralized package manager site.

This is because the designers of the Go do not like a central package manager, which will cause many problems. See: Using Go Modules

So let's design the Go support for our chatie/grpc, I believe it should:

  1. The go module should share the same proto buffer definition files from chatie/grpc repo, which means it should be put into the same DevOps process of our repo here.
  2. The go grpc generator script can be put at scripts/generate-stub-go.sh, like the Python scripts/generate-stub-py.sh as well.
  3. The require path of our chatie-grpc Go module should be: github.com/chatie/grpc/go/
  4. We should add a unit test to make sure the generated go stub version is matching our proto but file version.

This is just my initial version of the design, comments and suggestions are welcome, please feel free to start a discussion under this issue.

@dchaofei
Copy link
Contributor

Yes, this is the best, I mention pr to try

@huan
Copy link
Member Author

huan commented Apr 13, 2020

Great to know that you feel this is good too!

Looking forward to your PR then.

P.S. I'm also considering creating a new repo (e.g. wechaty/go-grpc) to store the generated Go stub codes instead to store in this repo because we will be easy to publish the generated Go code to another repository in our DevOps process, which I believe it will be cleaner and safer.

@huan
Copy link
Member Author

huan commented Apr 13, 2020

Merge to wechaty/go-grpc#1

@huan huan closed this as completed Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants