helloworld_grpc_pb.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // GENERATED CODE -- DO NOT EDIT!
  2. // Original file comments:
  3. // Copyright 2015 gRPC authors.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. 'use strict';
  18. var grpc = require('@grpc/grpc-js');
  19. var helloworld_pb = require('./helloworld_pb.js');
  20. function serialize_helloworld_HelloReply(arg) {
  21. if (!(arg instanceof helloworld_pb.HelloReply)) {
  22. throw new Error('Expected argument of type helloworld.HelloReply');
  23. }
  24. return Buffer.from(arg.serializeBinary());
  25. }
  26. function deserialize_helloworld_HelloReply(buffer_arg) {
  27. return helloworld_pb.HelloReply.deserializeBinary(new Uint8Array(buffer_arg));
  28. }
  29. function serialize_helloworld_HelloRequest(arg) {
  30. if (!(arg instanceof helloworld_pb.HelloRequest)) {
  31. throw new Error('Expected argument of type helloworld.HelloRequest');
  32. }
  33. return Buffer.from(arg.serializeBinary());
  34. }
  35. function deserialize_helloworld_HelloRequest(buffer_arg) {
  36. return helloworld_pb.HelloRequest.deserializeBinary(new Uint8Array(buffer_arg));
  37. }
  38. // The greeting service definition.
  39. var GreeterService = exports.GreeterService = {
  40. // Sends a greeting
  41. sayHello: {
  42. path: '/helloworld.Greeter/SayHello',
  43. requestStream: false,
  44. responseStream: false,
  45. requestType: helloworld_pb.HelloRequest,
  46. responseType: helloworld_pb.HelloReply,
  47. requestSerialize: serialize_helloworld_HelloRequest,
  48. requestDeserialize: deserialize_helloworld_HelloRequest,
  49. responseSerialize: serialize_helloworld_HelloReply,
  50. responseDeserialize: deserialize_helloworld_HelloReply,
  51. },
  52. };
  53. exports.GreeterClient = grpc.makeGenericClientConstructor(GreeterService);