Debian Codegraph @

examples/node/static_codegen/helloworld_grpc_pb.js

raw
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';
19 var grpc = require('@grpc/grpc-js');
20 var helloworld_pb = require('./helloworld_pb.js');
21
22 function serialize_helloworld_HelloReply(arg) {
23 if (!(arg instanceof helloworld_pb.HelloReply)) {
24 throw new Error('Expected argument of type helloworld.HelloReply');
25 }
26 return Buffer.from(arg.serializeBinary());
27 }
28
29 function deserialize_helloworld_HelloReply(buffer_arg) {
30 return helloworld_pb.HelloReply.deserializeBinary(new Uint8Array(buffer_arg));
31 }
32
33 function serialize_helloworld_HelloRequest(arg) {
34 if (!(arg instanceof helloworld_pb.HelloRequest)) {
35 throw new Error('Expected argument of type helloworld.HelloRequest');
36 }
37 return Buffer.from(arg.serializeBinary());
38 }
39
40 function deserialize_helloworld_HelloRequest(buffer_arg) {
41 return helloworld_pb.HelloRequest.deserializeBinary(new Uint8Array(buffer_arg));
42 }
43
44
45 // The greeting service definition.
46 var 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_helloworld_HelloRequest,
55 requestDeserialize: deserialize_helloworld_HelloRequest,
56 responseSerialize: serialize_helloworld_HelloReply,
57 responseDeserialize: deserialize_helloworld_HelloReply,
58 },
59 };
60
61 exports.GreeterClient = grpc.makeGenericClientConstructor(GreeterService);