Skip to content
grpc中Any类型在node的应用
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js

README.md

grpc-any-node-demo

grpc中Any类型在node的应用

如何使用

const Client = require('./index')
const client = new Client({
  ip,
  packageName: 'hello',
  // proto中设置到Any类型字段中的message
  msgProto: 'HeiProto',
  // 编译后的两个proto文件
  servicePath: grpcProtoPath,
  messagesPath: protoPath,
})

client.grpcSend({
  field1: 'xx',
  field2: 'xxx',
  extra: {
    field3: 'xxx',
  }
})

该demo仅供参考,如extra字段为现proto定义好的google.protobuf.Any类型

关于grpc趟了一些坑,记录了篇博客grpc的Any类型在node中应用

You can’t perform that action at this time.