Debian Codegraph @

examples/node/static_codegen/route_guide/route_guide_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 route_guide_pb = require('./route_guide_pb.js');
21
22 function serialize_routeguide_Feature(arg) {
23 if (!(arg instanceof route_guide_pb.Feature)) {
24 throw new Error('Expected argument of type routeguide.Feature');
25 }
26 return Buffer.from(arg.serializeBinary());
27 }
28
29 function deserialize_routeguide_Feature(buffer_arg) {
30 return route_guide_pb.Feature.deserializeBinary(new Uint8Array(buffer_arg));
31 }
32
33 function serialize_routeguide_Point(arg) {
34 if (!(arg instanceof route_guide_pb.Point)) {
35 throw new Error('Expected argument of type routeguide.Point');
36 }
37 return Buffer.from(arg.serializeBinary());
38 }
39
40 function deserialize_routeguide_Point(buffer_arg) {
41 return route_guide_pb.Point.deserializeBinary(new Uint8Array(buffer_arg));
42 }
43
44 function serialize_routeguide_Rectangle(arg) {
45 if (!(arg instanceof route_guide_pb.Rectangle)) {
46 throw new Error('Expected argument of type routeguide.Rectangle');
47 }
48 return Buffer.from(arg.serializeBinary());
49 }
50
51 function deserialize_routeguide_Rectangle(buffer_arg) {
52 return route_guide_pb.Rectangle.deserializeBinary(new Uint8Array(buffer_arg));
53 }
54
55 function serialize_routeguide_RouteNote(arg) {
56 if (!(arg instanceof route_guide_pb.RouteNote)) {
57 throw new Error('Expected argument of type routeguide.RouteNote');
58 }
59 return Buffer.from(arg.serializeBinary());
60 }
61
62 function deserialize_routeguide_RouteNote(buffer_arg) {
63 return route_guide_pb.RouteNote.deserializeBinary(new Uint8Array(buffer_arg));
64 }
65
66 function serialize_routeguide_RouteSummary(arg) {
67 if (!(arg instanceof route_guide_pb.RouteSummary)) {
68 throw new Error('Expected argument of type routeguide.RouteSummary');
69 }
70 return Buffer.from(arg.serializeBinary());
71 }
72
73 function deserialize_routeguide_RouteSummary(buffer_arg) {
74 return route_guide_pb.RouteSummary.deserializeBinary(new Uint8Array(buffer_arg));
75 }
76
77
78 // Interface exported by the server.
79 var RouteGuideService = exports.RouteGuideService = {
80 // A simple RPC.
81 //
82 // Obtains the feature at a given position.
83 //
84 // A feature with an empty name is returned if there's no feature at the given
85 // position.
86 getFeature: {
87 path: '/routeguide.RouteGuide/GetFeature',
88 requestStream: false,
89 responseStream: false,
90 requestType: route_guide_pb.Point,
91 responseType: route_guide_pb.Feature,
92 requestSerialize: serialize_routeguide_Point,
93 requestDeserialize: deserialize_routeguide_Point,
94 responseSerialize: serialize_routeguide_Feature,
95 responseDeserialize: deserialize_routeguide_Feature,
96 },
97 // A server-to-client streaming RPC.
98 //
99 // Obtains the Features available within the given Rectangle. Results are
100 // streamed rather than returned at once (e.g. in a response message with a
101 // repeated field), as the rectangle may cover a large area and contain a
102 // huge number of features.
103 listFeatures: {
104 path: '/routeguide.RouteGuide/ListFeatures',
105 requestStream: false,
106 responseStream: true,
107 requestType: route_guide_pb.Rectangle,
108 responseType: route_guide_pb.Feature,
109 requestSerialize: serialize_routeguide_Rectangle,
110 requestDeserialize: deserialize_routeguide_Rectangle,
111 responseSerialize: serialize_routeguide_Feature,
112 responseDeserialize: deserialize_routeguide_Feature,
113 },
114 // A client-to-server streaming RPC.
115 //
116 // Accepts a stream of Points on a route being traversed, returning a
117 // RouteSummary when traversal is completed.
118 recordRoute: {
119 path: '/routeguide.RouteGuide/RecordRoute',
120 requestStream: true,
121 responseStream: false,
122 requestType: route_guide_pb.Point,
123 responseType: route_guide_pb.RouteSummary,
124 requestSerialize: serialize_routeguide_Point,
125 requestDeserialize: deserialize_routeguide_Point,
126 responseSerialize: serialize_routeguide_RouteSummary,
127 responseDeserialize: deserialize_routeguide_RouteSummary,
128 },
129 // A Bidirectional streaming RPC.
130 //
131 // Accepts a stream of RouteNotes sent while a route is being traversed,
132 // while receiving other RouteNotes (e.g. from other users).
133 routeChat: {
134 path: '/routeguide.RouteGuide/RouteChat',
135 requestStream: true,
136 responseStream: true,
137 requestType: route_guide_pb.RouteNote,
138 responseType: route_guide_pb.RouteNote,
139 requestSerialize: serialize_routeguide_RouteNote,
140 requestDeserialize: deserialize_routeguide_RouteNote,
141 responseSerialize: serialize_routeguide_RouteNote,
142 responseDeserialize: deserialize_routeguide_RouteNote,
143 },
144 };
145
146 exports.RouteGuideClient = grpc.makeGenericClientConstructor(RouteGuideService);