@juzi/wechaty-grpc
v1.0.89
Published
gRPC for Wechaty
Downloads
1,722
Readme
About
gRPC is a modern open-source high-performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking, and authentication. It is also applicable in the last mile of distributed computing to connect devices, mobile applications, and browsers to backend services.
Usage
Node.js
Docs:
Maintainer:
- @huan - Huan LI (李卓桓)
Python
Maintainer:
- @wj-Mcat - Jingjing WU (吴京京)
Go
Maintainer:
- @dchaofei - Chaofei DING (丁超飞)
Java
https://mvnrepository.com/artifact/io.github.wechaty/grpc
Maven:
<dependency>
<groupId>io.github.wechaty</groupId>
<version>0.11.25</version>
<artifactId>grpc</artifactId>
</dependency>
Gradle:
compile 'io.github.wechaty:grpc:0.11.25'
Maintainer:
- @diaozxin007 - Zhengxin DIAO (刁政欣)
PHP
Maintainer:
- @zhangchunsheng - Chunsheng ZHANG (张春生)
CSharp
Maintainer:
- @Darren - Darren (郑波)
Development
Debug
- GUI Client for GRPC Services - BloomRPC aims to give the simplest and efficient developer experience for exploring and querying your GRPC services. (Inspired by Postman and GraphQL Playground)
- A gRPC CLI interface for easy testing against gRPC servers with Node.js REPL
grpcc --proto ./service/myservice.proto --address 127.0.0.1:3466
Build
./scripts/install-protoc.sh
npm install
Generate Stubs
npm run generate
1. JS for Protocol Buffer
protoc \
--js_out="import_style=commonjs,binary:${OUT_DIR}"
2. JS for gRPC Stubs
protoc \
--plugin="protoc-gen-grpc=`which grpc_tools_node_protoc_plugin`" \
--grpc_out="${OUT_DIR}"
3. TypeScript Typing Definations for Protocol Buffer & gRPC Stubs
protoc \
--plugin="protoc-gen-grpc=node_modules/grpc_tools_node_protoc_ts/bin/protoc-gen-ts" \
--grpc_out="${OUT_DIR}"
4. JS & TS for gRPC Web
protoc \
--plugin="protoc-gen-ts=node_modules/ts-protoc-gen/bin/protoc-gen-ts" \
--ts_out="service=true:${OUT_DIR}"
Naming conventions & Style Guide
OpenAPI
Learn more about the RESTful API service for Wechaty from Wechaty OpenAPI.
gRPC Web
RESOURCES
Documentation
- Protocol Buffers Language Guide (proto3)
- Google Protocol Buffers Style Guide
- Protocol Buffers for TypeScript with Decorators
- Troubleshooting gRPC
- gRPC environment variables
- How to Interact With and Debug a gRPC Server
Links
- 探讨gRPC的Node技术生态及实现工具
- gRPC Basics - Node.js
- Building a gRPC service with Node.js
- gRPC in 3 minutes (Node.js)
- Listen gRPC and HTTP requests on the same port
- gRPC to JSON proxy generator following the gRPC HTTP spec
- 如何在 Node.js 中更优雅地使用 gRPC:grpc-helper
- Comparing OpenAPI With gRPC
Protocol Buffer
Thanks to the ecosystem of gRPC, we can generate OpenAPI Specification from our gRPC proto definitions automatically.
We are using gRPC to JSON proxy generator following the gRPC HTTP spec as the OpenAPI Specification generator (protoc-gen-openapiv2), and using Like grpc-gateway, but written in node and dynamic project to serve an HTTP RESTful API to gRPC proxy.
Image credit: gRPC Gateway
Learn more about the RESTful API service for Wechaty from Wechaty OpenAPI.
See also:
gRPC Web
Resources
Check out RESOURCES.md file for learning resources.
Guidelines
- Google Protocol Buffers Style Guide
- Google Cloud API Naming Conventions
- Google Cloud Cloud API Design Guide
Changelog
master v1.0 (Mar 14, 2022)
- v1.0 release
- add
post
event
v0.33 (Oct 18, 2021)
- ~~[ ] Rename
ENUM
fromCONTACT_GENDER_MALE
toMALE
(#110)~~ - [ ] Fix typos
v0.27
- ES Modules support
- Export generated protocol buffers class as
puppet
v0.20 (Feb 21, 2021)
- Rename NPM module name from
@chatie/grpc
towechaty-grpc
- Add OpenAPI annotations & generators for supporting https://github.com/wechaty/openapi
- Code clean.
v0.18 (Oct 15, 2020)
- Add new
MessageFileStream
andMessageImageStream
to replace theMessageFile
andMessageImage
method to avoid blocking nodejs event loop when sending large files (#88) by @windmemory - Add new
MessageSendFileStream
to replace theMessageSendFile
method to avoid blocking nodejs event loop when sending large files (#89) by @windmemory
v0.17 (Aug 5, 2020)
- Add PHH Support (#76 #78) by @zhangchunsheng
- Publish PHP Module at https://github.com/wechaty/php-grpc
v0.13 (Apr 19, 2020)
- Add Java Support (#52 #53 by @diaozxin007)
- Publish Java Module at Open Source Project Repository HostingOSSRH-56843 - Release the Chatie/grpc Java Client
v0.11 (Apr 10, 2020)
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
See CONTRIBUTING.md for more details.
Releases
Since its creation in 2016, a number of Wechaty versions have been released. For more information about the release history and the current stable version, you can read the Wechaty release notes on Github.
Contributors
Made with contrib.rocks.
Maintainer
Wechaty is maintained by Huan, Rui, and a community of Open Source Contributors. We are always looking for people to join the Wechaty community to maintain the Wechaty codebase and documentation. You necessarily don't have to be a programmer to contribute to Wechaty. To get started contributing, you can read the CONTRIBUTING.md.
Getting help
Wechaty has a community of very helpful contributors on different platforms you can join to get help from. Before joining any of the communities, we recommend that you read our Code of conduct]o that you adhere to our community guidelines. A full list of the different Wechaty communities can be accessed from the Wechaty community section of this documentation.
Copyright & License
Wechaty is an Open Source Project. It is released under Apache-2.0 license and the corresponding documentation is released under the Creative Commons license.