Skip to content

jiandandkl/grpc-any-node-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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中应用

About

grpc中Any类型在node的应用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published