【发布时间】:2017-10-26 12:31:19
【问题描述】:
我想获取 gRPC 中服务器的所有方法(gPRC 方法名称)的列表。我没有在 NodeJS gRPC 引用中找到方法或属性来获取 gRPC 方法列表 - https://grpc.io/grpc/node/grpc.Server.html。我怎样才能做到这一点?谢谢)
【问题讨论】:
标签: javascript node.js grpc
我想获取 gRPC 中服务器的所有方法(gPRC 方法名称)的列表。我没有在 NodeJS gRPC 引用中找到方法或属性来获取 gRPC 方法列表 - https://grpc.io/grpc/node/grpc.Server.html。我怎样才能做到这一点?谢谢)
【问题讨论】:
标签: javascript node.js grpc
const Service = grpc.load(protoPath).examplePackage.exampleService;
// your methods:
const methods = Object.keys(Service.prototype);
我从here得到了解决方案
【讨论】: