Lines Matching full:print
41 printer->Print(vars, "if $Error_Check$ {\n"); in GenerateError()
44 printer->Print(vars, "return $Return$\n"); in GenerateError()
46 printer->Print("}\n"); in GenerateError()
54 printer->Print("//Generated by gRPC Go plugin\n"); in GenerateImports()
55 printer->Print("//If you make any local changes, they will be lost\n"); in GenerateImports()
56 printer->Print(vars, "//source: $filename$\n\n"); in GenerateImports()
57 printer->Print(vars, "package $Package$\n\n"); in GenerateImports()
58 printer->Print("import (\n"); in GenerateImports()
60 printer->Print(vars, "$context$ \"context\"\n"); in GenerateImports()
61 printer->Print("flatbuffers \"github.com/google/flatbuffers/go\"\n"); in GenerateImports()
62 printer->Print(vars, "$grpc$ \"google.golang.org/grpc\"\n"); in GenerateImports()
63 printer->Print("\"google.golang.org/grpc/codes\"\n"); in GenerateImports()
64 printer->Print("\"google.golang.org/grpc/status\"\n"); in GenerateImports()
66 printer->Print(")\n\n"); in GenerateImports()
79 printer->Print( in GenerateServerMethodSignature()
83 printer->Print( in GenerateServerMethodSignature()
86 printer->Print(vars, "$Method$($Service$_$Method$Server) error$Ending$"); in GenerateServerMethodSignature()
102 printer->Print( in GenerateServerMethod()
108 printer->Print(vars, "in := new($Request$)\n"); in GenerateServerMethod()
111 printer->Print("if interceptor == nil {\n"); in GenerateServerMethod()
113 printer->Print(vars, "return srv.($Service$Server).$Method$(ctx, in)\n"); in GenerateServerMethod()
115 printer->Print("}\n"); in GenerateServerMethod()
116 printer->Print(vars, "info := &$grpc$.UnaryServerInfo{\n"); in GenerateServerMethod()
118 printer->Print("Server: srv,\n"); in GenerateServerMethod()
119 printer->Print(vars, "FullMethod: \"$FullMethodName$\",\n"); in GenerateServerMethod()
121 printer->Print("}\n"); in GenerateServerMethod()
123 printer->Print("\n"); in GenerateServerMethod()
125 printer->Print(vars, in GenerateServerMethod()
129 printer->Print( in GenerateServerMethod()
132 printer->Print("}\n"); in GenerateServerMethod()
133 printer->Print("return interceptor(ctx, in, info, handler)\n"); in GenerateServerMethod()
135 printer->Print("}\n"); in GenerateServerMethod()
139 printer->Print( in GenerateServerMethod()
144 printer->Print(vars, "m := new($Request$)\n"); in GenerateServerMethod()
147 printer->Print( in GenerateServerMethod()
151 printer->Print( in GenerateServerMethod()
155 printer->Print("}\n\n"); in GenerateServerMethod()
161 printer->Print(vars, "type $Service$_$Method$Server interface {\n"); in GenerateServerMethod()
163 if (genSend) { printer->Print(vars, "Send(*$Response$) error\n"); } in GenerateServerMethod()
164 if (genRecv) { printer->Print(vars, "Recv() (*$Request$, error)\n"); } in GenerateServerMethod()
166 printer->Print(vars, "SendAndClose(*$Response$) error\n"); in GenerateServerMethod()
168 printer->Print(vars, "$grpc$.ServerStream\n"); in GenerateServerMethod()
170 printer->Print("}\n\n"); in GenerateServerMethod()
172 printer->Print(vars, "type $StreamType$ struct {\n"); in GenerateServerMethod()
174 printer->Print(vars, "$grpc$.ServerStream\n"); in GenerateServerMethod()
176 printer->Print("}\n\n"); in GenerateServerMethod()
179 printer->Print(vars, in GenerateServerMethod()
182 printer->Print("return x.ServerStream.SendMsg(m)\n"); in GenerateServerMethod()
184 printer->Print("}\n\n"); in GenerateServerMethod()
187 printer->Print(vars, in GenerateServerMethod()
190 printer->Print(vars, "m := new($Request$)\n"); in GenerateServerMethod()
193 printer->Print("return m, nil\n"); in GenerateServerMethod()
195 printer->Print("}\n\n"); in GenerateServerMethod()
198 printer->Print( in GenerateServerMethod()
201 printer->Print("return x.ServerStream.SendMsg(m)\n"); in GenerateServerMethod()
203 printer->Print("}\n\n"); in GenerateServerMethod()
223 printer->Print(vars, in GenerateClientMethodSignature()
232 printer->Print(vars, "func (c *$ServiceUnexported$Client) "); in GenerateClientMethod()
244 printer->Print(vars, "out := new($Response$)\n"); in GenerateClientMethod()
245 printer->Print( in GenerateClientMethod()
250 printer->Print("return out, nil\n"); in GenerateClientMethod()
252 printer->Print("}\n\n"); in GenerateClientMethod()
256 printer->Print(vars, in GenerateClientMethod()
262 printer->Print(vars, "x := &$StreamType${stream}\n"); in GenerateClientMethod()
269 printer->Print("return x, nil\n"); in GenerateClientMethod()
271 printer->Print("}\n\n"); in GenerateClientMethod()
278 printer->Print(vars, "type $Service$_$Method$Client interface {\n"); in GenerateClientMethod()
280 if (genSend) { printer->Print(vars, "Send(*$Request$) error\n"); } in GenerateClientMethod()
281 if (genRecv) { printer->Print(vars, "Recv() (*$Response$, error)\n"); } in GenerateClientMethod()
283 printer->Print(vars, "CloseAndRecv() (*$Response$, error)\n"); in GenerateClientMethod()
285 printer->Print(vars, "$grpc$.ClientStream\n"); in GenerateClientMethod()
287 printer->Print("}\n\n"); in GenerateClientMethod()
290 printer->Print(vars, "type $StreamType$ struct {\n"); in GenerateClientMethod()
292 printer->Print(vars, "$grpc$.ClientStream\n"); in GenerateClientMethod()
294 printer->Print("}\n\n"); in GenerateClientMethod()
297 printer->Print(vars, "func (x *$StreamType$) Send(m *$Request$) error {\n"); in GenerateClientMethod()
299 printer->Print("return x.ClientStream.SendMsg(m)\n"); in GenerateClientMethod()
301 printer->Print("}\n\n"); in GenerateClientMethod()
305 printer->Print(vars, in GenerateClientMethod()
308 printer->Print(vars, "m := new($Response$)\n"); in GenerateClientMethod()
311 printer->Print("return m, nil\n"); in GenerateClientMethod()
313 printer->Print("}\n\n"); in GenerateClientMethod()
317 printer->Print( in GenerateClientMethod()
322 printer->Print(vars, "m := new($Response$)\n"); in GenerateClientMethod()
325 printer->Print("return m, nil\n"); in GenerateClientMethod()
327 printer->Print("}\n\n"); in GenerateClientMethod()
337 printer->Print(vars, "// Client API for $Service$ service\n"); in GenerateService()
338 printer->Print(vars, "type $Service$Client interface {\n"); in GenerateService()
345 printer->Print("}\n\n"); in GenerateService()
349 printer->Print(vars, "type $ServiceUnexported$Client struct {\n"); in GenerateService()
351 printer->Print(vars, "cc $grpc$.ClientConnInterface\n"); in GenerateService()
353 printer->Print("}\n\n"); in GenerateService()
356 printer->Print(vars, in GenerateService()
360 printer->Print(vars, "return &$ServiceUnexported$Client{cc}"); in GenerateService()
362 printer->Print("\n}\n\n"); in GenerateService()
381 printer->Print(vars, "// Server API for $Service$ service\n"); in GenerateService()
382 printer->Print(vars, "type $Service$Server interface {\n"); in GenerateService()
388 printer->Print(vars, "mustEmbedUnimplemented$Service$Server()\n"); in GenerateService()
390 printer->Print("}\n\n"); in GenerateService()
392 printer->Print(vars, "type Unimplemented$Service$Server struct {\n"); in GenerateService()
393 printer->Print("}\n\n"); in GenerateService()
400 printer->Print(vars, "func (Unimplemented$Service$Server) "); in GenerateService()
403 printer->Print(vars, in GenerateService()
407 printer->Print("}\n"); in GenerateService()
408 printer->Print("\n"); in GenerateService()
411 printer->Print(vars, in GenerateService()
414 printer->Print("\n\n"); in GenerateService()
416 printer->Print(vars, "type Unsafe$Service$Server interface {\n"); in GenerateService()
418 printer->Print(vars, "mustEmbedUnimplemented$Service$Server()\n"); in GenerateService()
420 printer->Print("}\n\n"); in GenerateService()
422 printer->Print(vars, in GenerateService()
426 printer->Print(vars, "s.RegisterService(&$ServiceDesc$, srv)\n"); in GenerateService()
428 printer->Print("}\n\n"); in GenerateService()
435 printer->Print(vars, "var $ServiceDesc$ = $grpc$.ServiceDesc{\n"); in GenerateService()
437 printer->Print(vars, "ServiceName: \"$ServicePrefix$$Service$\",\n"); in GenerateService()
438 printer->Print(vars, "HandlerType: (*$Service$Server)(nil),\n"); in GenerateService()
439 printer->Print(vars, "Methods: []$grpc$.MethodDesc{\n"); in GenerateService()
446 printer->Print("{\n"); in GenerateService()
448 printer->Print(vars, "MethodName: \"$Method$\",\n"); in GenerateService()
449 printer->Print(vars, "Handler: $Handler$,\n"); in GenerateService()
451 printer->Print("},\n"); in GenerateService()
455 printer->Print("},\n"); in GenerateService()
456 printer->Print(vars, "Streams: []$grpc$.StreamDesc{\n"); in GenerateService()
463 printer->Print("{\n"); in GenerateService()
465 printer->Print(vars, "StreamName: \"$Method$\",\n"); in GenerateService()
466 printer->Print(vars, "Handler: $Handler$,\n"); in GenerateService()
468 printer->Print("ClientStreams: true,\n"); in GenerateService()
470 printer->Print("ServerStreams: true,\n"); in GenerateService()
472 printer->Print("ServerStreams: true,\n"); in GenerateService()
473 printer->Print("ClientStreams: true,\n"); in GenerateService()
476 printer->Print("},\n"); in GenerateService()
480 printer->Print("},\n"); in GenerateService()
482 printer->Print("}\n"); in GenerateService()