• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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'use strict';
19var grpc = require('grpc');
20var helloworld_pb = require('./helloworld_pb.js');
21
22function serialize_HelloReply(arg) {
23  if (!(arg instanceof helloworld_pb.HelloReply)) {
24    throw new Error('Expected argument of type HelloReply');
25  }
26  return new Buffer(arg.serializeBinary());
27}
28
29function deserialize_HelloReply(buffer_arg) {
30  return helloworld_pb.HelloReply.deserializeBinary(new Uint8Array(buffer_arg));
31}
32
33function serialize_HelloRequest(arg) {
34  if (!(arg instanceof helloworld_pb.HelloRequest)) {
35    throw new Error('Expected argument of type HelloRequest');
36  }
37  return new Buffer(arg.serializeBinary());
38}
39
40function deserialize_HelloRequest(buffer_arg) {
41  return helloworld_pb.HelloRequest.deserializeBinary(new Uint8Array(buffer_arg));
42}
43
44
45// The greeting service definition.
46var GreeterService = exports.GreeterService = {
47  // Sends a greeting
48  sayHello: {
49    path: '/helloworld.Greeter/SayHello',
50    requestStream: false,
51    responseStream: false,
52    requestType: helloworld_pb.HelloRequest,
53    responseType: helloworld_pb.HelloReply,
54    requestSerialize: serialize_HelloRequest,
55    requestDeserialize: deserialize_HelloRequest,
56    responseSerialize: serialize_HelloReply,
57    responseDeserialize: deserialize_HelloReply,
58  },
59};
60
61exports.GreeterClient = grpc.makeGenericClientConstructor(GreeterService);
62