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