3.0.2 • Published 4 years ago

egg-grpc-client-ts v3.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

egg-grpc-client-ts

TypeScript version of egg grpc client plugin.

Inspired by egg-grpc-client.

NPM version Build Status codecov David deps Known Vulnerabilities npm download

Install

$ npm i egg-grpc-client-ts --save

Usage

// {app_root}/config/plugin.[t|j]s
exports.grpcClient = {
  enable: true,
  package: 'egg-grpc-client-ts',
};

Configuration

// {app_root}/config/config.default.[t|j]s
exports.grpcClient = {
  clients: [
    {
      name: 'main',
      protoPath: 'app/proto/main',
      host: '0.0.0.0',
      port: 50051,
    },
  ],
};

see config/config.default.ts for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Test

# start test grpc server
npm run test-server

# In another shell, run:
npm run test-local

Release Notes:

  • 1.1.5: 报错时,把相关 server address, service, method, 参数 等元信息带上。

  • 1.1.6: fail fast。默认超时时间为 10 秒(原来默认 1 分钟,太长了)

  • 2.0.1: 允许传入 grpcMeta,实现分布式链路跟踪

  • 2.1.0: grpc 健康检查

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago