github.com/Minish144/prototool-arm64@v1.3.0/example/gen/proto/go/foo/foo.pb.yarpc.go (about) 1 // Code generated by protoc-gen-yarpc-go 2 // source: foo/foo.proto 3 // DO NOT EDIT! 4 5 package foopb 6 7 import ( 8 "context" 9 "io/ioutil" 10 "reflect" 11 12 "github.com/gogo/protobuf/proto" 13 "github.com/uber/prototool/example/gen/proto/go/sub" 14 "go.uber.org/fx" 15 "go.uber.org/yarpc" 16 "go.uber.org/yarpc/api/transport" 17 "go.uber.org/yarpc/encoding/protobuf" 18 ) 19 20 var _ = ioutil.NopCloser 21 22 // HelloServiceYARPCClient is the YARPC client-side interface for the HelloService service. 23 type HelloServiceYARPCClient interface { 24 Foo(context.Context, *subpb.Dep, ...yarpc.CallOption) (*FooResponse, error) 25 Bar(context.Context, *BarRequest, ...yarpc.CallOption) (*Dep, error) 26 } 27 28 // NewHelloServiceYARPCClient builds a new YARPC client for the HelloService service. 29 func NewHelloServiceYARPCClient(clientConfig transport.ClientConfig, options ...protobuf.ClientOption) HelloServiceYARPCClient { 30 return &_HelloServiceYARPCCaller{protobuf.NewStreamClient( 31 protobuf.ClientParams{ 32 ServiceName: "foo.HelloService", 33 ClientConfig: clientConfig, 34 Options: options, 35 }, 36 )} 37 } 38 39 // HelloServiceYARPCServer is the YARPC server-side interface for the HelloService service. 40 type HelloServiceYARPCServer interface { 41 Foo(context.Context, *subpb.Dep) (*FooResponse, error) 42 Bar(context.Context, *BarRequest) (*Dep, error) 43 } 44 45 // BuildHelloServiceYARPCProcedures prepares an implementation of the HelloService service for YARPC registration. 46 func BuildHelloServiceYARPCProcedures(server HelloServiceYARPCServer) []transport.Procedure { 47 handler := &_HelloServiceYARPCHandler{server} 48 return protobuf.BuildProcedures( 49 protobuf.BuildProceduresParams{ 50 ServiceName: "foo.HelloService", 51 UnaryHandlerParams: []protobuf.BuildProceduresUnaryHandlerParams{ 52 { 53 MethodName: "Foo", 54 Handler: protobuf.NewUnaryHandler( 55 protobuf.UnaryHandlerParams{ 56 Handle: handler.Foo, 57 NewRequest: newHelloServiceServiceFooYARPCRequest, 58 }, 59 ), 60 }, 61 { 62 MethodName: "Bar", 63 Handler: protobuf.NewUnaryHandler( 64 protobuf.UnaryHandlerParams{ 65 Handle: handler.Bar, 66 NewRequest: newHelloServiceServiceBarYARPCRequest, 67 }, 68 ), 69 }, 70 }, 71 OnewayHandlerParams: []protobuf.BuildProceduresOnewayHandlerParams{}, 72 StreamHandlerParams: []protobuf.BuildProceduresStreamHandlerParams{}, 73 }, 74 ) 75 } 76 77 // FxHelloServiceYARPCClientParams defines the input 78 // for NewFxHelloServiceYARPCClient. It provides the 79 // paramaters to get a HelloServiceYARPCClient in an 80 // Fx application. 81 type FxHelloServiceYARPCClientParams struct { 82 fx.In 83 84 Provider yarpc.ClientConfig 85 } 86 87 // FxHelloServiceYARPCClientResult defines the output 88 // of NewFxHelloServiceYARPCClient. It provides a 89 // HelloServiceYARPCClient to an Fx application. 90 type FxHelloServiceYARPCClientResult struct { 91 fx.Out 92 93 Client HelloServiceYARPCClient 94 95 // We are using an fx.Out struct here instead of just returning a client 96 // so that we can add more values or add named versions of the client in 97 // the future without breaking any existing code. 98 } 99 100 // NewFxHelloServiceYARPCClient provides a HelloServiceYARPCClient 101 // to an Fx application using the given name for routing. 102 // 103 // fx.Provide( 104 // foopb.NewFxHelloServiceYARPCClient("service-name"), 105 // ... 106 // ) 107 func NewFxHelloServiceYARPCClient(name string, options ...protobuf.ClientOption) interface{} { 108 return func(params FxHelloServiceYARPCClientParams) FxHelloServiceYARPCClientResult { 109 return FxHelloServiceYARPCClientResult{ 110 Client: NewHelloServiceYARPCClient(params.Provider.ClientConfig(name), options...), 111 } 112 } 113 } 114 115 // FxHelloServiceYARPCProceduresParams defines the input 116 // for NewFxHelloServiceYARPCProcedures. It provides the 117 // paramaters to get HelloServiceYARPCServer procedures in an 118 // Fx application. 119 type FxHelloServiceYARPCProceduresParams struct { 120 fx.In 121 122 Server HelloServiceYARPCServer 123 } 124 125 // FxHelloServiceYARPCProceduresResult defines the output 126 // of NewFxHelloServiceYARPCProcedures. It provides 127 // HelloServiceYARPCServer procedures to an Fx application. 128 // 129 // The procedures are provided to the "yarpcfx" value group. 130 // Dig 1.2 or newer must be used for this feature to work. 131 type FxHelloServiceYARPCProceduresResult struct { 132 fx.Out 133 134 Procedures []transport.Procedure `group:"yarpcfx"` 135 } 136 137 // NewFxHelloServiceYARPCProcedures provides HelloServiceYARPCServer procedures to an Fx application. 138 // It expects a HelloServiceYARPCServer to be present in the container. 139 // 140 // fx.Provide( 141 // foopb.NewFxHelloServiceYARPCProcedures(), 142 // ... 143 // ) 144 func NewFxHelloServiceYARPCProcedures() interface{} { 145 return func(params FxHelloServiceYARPCProceduresParams) FxHelloServiceYARPCProceduresResult { 146 return FxHelloServiceYARPCProceduresResult{ 147 Procedures: BuildHelloServiceYARPCProcedures(params.Server), 148 } 149 } 150 } 151 152 type _HelloServiceYARPCCaller struct { 153 streamClient protobuf.StreamClient 154 } 155 156 func (c *_HelloServiceYARPCCaller) Foo(ctx context.Context, request *subpb.Dep, options ...yarpc.CallOption) (*FooResponse, error) { 157 responseMessage, err := c.streamClient.Call(ctx, "Foo", request, newHelloServiceServiceFooYARPCResponse, options...) 158 if responseMessage == nil { 159 return nil, err 160 } 161 response, ok := responseMessage.(*FooResponse) 162 if !ok { 163 return nil, protobuf.CastError(emptyHelloServiceServiceFooYARPCResponse, responseMessage) 164 } 165 return response, err 166 } 167 168 func (c *_HelloServiceYARPCCaller) Bar(ctx context.Context, request *BarRequest, options ...yarpc.CallOption) (*Dep, error) { 169 responseMessage, err := c.streamClient.Call(ctx, "Bar", request, newHelloServiceServiceBarYARPCResponse, options...) 170 if responseMessage == nil { 171 return nil, err 172 } 173 response, ok := responseMessage.(*Dep) 174 if !ok { 175 return nil, protobuf.CastError(emptyHelloServiceServiceBarYARPCResponse, responseMessage) 176 } 177 return response, err 178 } 179 180 type _HelloServiceYARPCHandler struct { 181 server HelloServiceYARPCServer 182 } 183 184 func (h *_HelloServiceYARPCHandler) Foo(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { 185 var request *subpb.Dep 186 var ok bool 187 if requestMessage != nil { 188 request, ok = requestMessage.(*subpb.Dep) 189 if !ok { 190 return nil, protobuf.CastError(emptyHelloServiceServiceFooYARPCRequest, requestMessage) 191 } 192 } 193 response, err := h.server.Foo(ctx, request) 194 if response == nil { 195 return nil, err 196 } 197 return response, err 198 } 199 200 func (h *_HelloServiceYARPCHandler) Bar(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { 201 var request *BarRequest 202 var ok bool 203 if requestMessage != nil { 204 request, ok = requestMessage.(*BarRequest) 205 if !ok { 206 return nil, protobuf.CastError(emptyHelloServiceServiceBarYARPCRequest, requestMessage) 207 } 208 } 209 response, err := h.server.Bar(ctx, request) 210 if response == nil { 211 return nil, err 212 } 213 return response, err 214 } 215 216 func newHelloServiceServiceFooYARPCRequest() proto.Message { 217 return &subpb.Dep{} 218 } 219 220 func newHelloServiceServiceFooYARPCResponse() proto.Message { 221 return &FooResponse{} 222 } 223 224 func newHelloServiceServiceBarYARPCRequest() proto.Message { 225 return &BarRequest{} 226 } 227 228 func newHelloServiceServiceBarYARPCResponse() proto.Message { 229 return &Dep{} 230 } 231 232 var ( 233 emptyHelloServiceServiceFooYARPCRequest = &subpb.Dep{} 234 emptyHelloServiceServiceFooYARPCResponse = &FooResponse{} 235 emptyHelloServiceServiceBarYARPCRequest = &BarRequest{} 236 emptyHelloServiceServiceBarYARPCResponse = &Dep{} 237 ) 238 239 // ExcitedServiceYARPCClient is the YARPC client-side interface for the ExcitedService service. 240 type ExcitedServiceYARPCClient interface { 241 Exclamation(context.Context, *ExclamationRequest, ...yarpc.CallOption) (*ExclamationResponse, error) 242 ExclamationClientStream(context.Context, ...yarpc.CallOption) (ExcitedServiceServiceExclamationClientStreamYARPCClient, error) 243 ExclamationServerStream(context.Context, *ExclamationRequest, ...yarpc.CallOption) (ExcitedServiceServiceExclamationServerStreamYARPCClient, error) 244 ExclamationBidiStream(context.Context, ...yarpc.CallOption) (ExcitedServiceServiceExclamationBidiStreamYARPCClient, error) 245 } 246 247 // ExcitedServiceServiceExclamationClientStreamYARPCClient sends ExclamationRequests and receives the single ExclamationResponse when sending is done. 248 type ExcitedServiceServiceExclamationClientStreamYARPCClient interface { 249 Context() context.Context 250 Send(*ExclamationRequest, ...yarpc.StreamOption) error 251 CloseAndRecv(...yarpc.StreamOption) (*ExclamationResponse, error) 252 } 253 254 // ExcitedServiceServiceExclamationServerStreamYARPCClient receives ExclamationResponses, returning io.EOF when the stream is complete. 255 type ExcitedServiceServiceExclamationServerStreamYARPCClient interface { 256 Context() context.Context 257 Recv(...yarpc.StreamOption) (*ExclamationResponse, error) 258 CloseSend(...yarpc.StreamOption) error 259 } 260 261 // ExcitedServiceServiceExclamationBidiStreamYARPCClient sends ExclamationRequests and receives ExclamationResponses, returning io.EOF when the stream is complete. 262 type ExcitedServiceServiceExclamationBidiStreamYARPCClient interface { 263 Context() context.Context 264 Send(*ExclamationRequest, ...yarpc.StreamOption) error 265 Recv(...yarpc.StreamOption) (*ExclamationResponse, error) 266 CloseSend(...yarpc.StreamOption) error 267 } 268 269 // NewExcitedServiceYARPCClient builds a new YARPC client for the ExcitedService service. 270 func NewExcitedServiceYARPCClient(clientConfig transport.ClientConfig, options ...protobuf.ClientOption) ExcitedServiceYARPCClient { 271 return &_ExcitedServiceYARPCCaller{protobuf.NewStreamClient( 272 protobuf.ClientParams{ 273 ServiceName: "foo.ExcitedService", 274 ClientConfig: clientConfig, 275 Options: options, 276 }, 277 )} 278 } 279 280 // ExcitedServiceYARPCServer is the YARPC server-side interface for the ExcitedService service. 281 type ExcitedServiceYARPCServer interface { 282 Exclamation(context.Context, *ExclamationRequest) (*ExclamationResponse, error) 283 ExclamationClientStream(ExcitedServiceServiceExclamationClientStreamYARPCServer) (*ExclamationResponse, error) 284 ExclamationServerStream(*ExclamationRequest, ExcitedServiceServiceExclamationServerStreamYARPCServer) error 285 ExclamationBidiStream(ExcitedServiceServiceExclamationBidiStreamYARPCServer) error 286 } 287 288 // ExcitedServiceServiceExclamationClientStreamYARPCServer receives ExclamationRequests. 289 type ExcitedServiceServiceExclamationClientStreamYARPCServer interface { 290 Context() context.Context 291 Recv(...yarpc.StreamOption) (*ExclamationRequest, error) 292 } 293 294 // ExcitedServiceServiceExclamationServerStreamYARPCServer sends ExclamationResponses. 295 type ExcitedServiceServiceExclamationServerStreamYARPCServer interface { 296 Context() context.Context 297 Send(*ExclamationResponse, ...yarpc.StreamOption) error 298 } 299 300 // ExcitedServiceServiceExclamationBidiStreamYARPCServer receives ExclamationRequests and sends ExclamationResponse. 301 type ExcitedServiceServiceExclamationBidiStreamYARPCServer interface { 302 Context() context.Context 303 Recv(...yarpc.StreamOption) (*ExclamationRequest, error) 304 Send(*ExclamationResponse, ...yarpc.StreamOption) error 305 } 306 307 // BuildExcitedServiceYARPCProcedures prepares an implementation of the ExcitedService service for YARPC registration. 308 func BuildExcitedServiceYARPCProcedures(server ExcitedServiceYARPCServer) []transport.Procedure { 309 handler := &_ExcitedServiceYARPCHandler{server} 310 return protobuf.BuildProcedures( 311 protobuf.BuildProceduresParams{ 312 ServiceName: "foo.ExcitedService", 313 UnaryHandlerParams: []protobuf.BuildProceduresUnaryHandlerParams{ 314 { 315 MethodName: "Exclamation", 316 Handler: protobuf.NewUnaryHandler( 317 protobuf.UnaryHandlerParams{ 318 Handle: handler.Exclamation, 319 NewRequest: newExcitedServiceServiceExclamationYARPCRequest, 320 }, 321 ), 322 }, 323 }, 324 OnewayHandlerParams: []protobuf.BuildProceduresOnewayHandlerParams{}, 325 StreamHandlerParams: []protobuf.BuildProceduresStreamHandlerParams{ 326 { 327 MethodName: "ExclamationBidiStream", 328 Handler: protobuf.NewStreamHandler( 329 protobuf.StreamHandlerParams{ 330 Handle: handler.ExclamationBidiStream, 331 }, 332 ), 333 }, 334 335 { 336 MethodName: "ExclamationServerStream", 337 Handler: protobuf.NewStreamHandler( 338 protobuf.StreamHandlerParams{ 339 Handle: handler.ExclamationServerStream, 340 }, 341 ), 342 }, 343 344 { 345 MethodName: "ExclamationClientStream", 346 Handler: protobuf.NewStreamHandler( 347 protobuf.StreamHandlerParams{ 348 Handle: handler.ExclamationClientStream, 349 }, 350 ), 351 }, 352 }, 353 }, 354 ) 355 } 356 357 // FxExcitedServiceYARPCClientParams defines the input 358 // for NewFxExcitedServiceYARPCClient. It provides the 359 // paramaters to get a ExcitedServiceYARPCClient in an 360 // Fx application. 361 type FxExcitedServiceYARPCClientParams struct { 362 fx.In 363 364 Provider yarpc.ClientConfig 365 } 366 367 // FxExcitedServiceYARPCClientResult defines the output 368 // of NewFxExcitedServiceYARPCClient. It provides a 369 // ExcitedServiceYARPCClient to an Fx application. 370 type FxExcitedServiceYARPCClientResult struct { 371 fx.Out 372 373 Client ExcitedServiceYARPCClient 374 375 // We are using an fx.Out struct here instead of just returning a client 376 // so that we can add more values or add named versions of the client in 377 // the future without breaking any existing code. 378 } 379 380 // NewFxExcitedServiceYARPCClient provides a ExcitedServiceYARPCClient 381 // to an Fx application using the given name for routing. 382 // 383 // fx.Provide( 384 // foopb.NewFxExcitedServiceYARPCClient("service-name"), 385 // ... 386 // ) 387 func NewFxExcitedServiceYARPCClient(name string, options ...protobuf.ClientOption) interface{} { 388 return func(params FxExcitedServiceYARPCClientParams) FxExcitedServiceYARPCClientResult { 389 return FxExcitedServiceYARPCClientResult{ 390 Client: NewExcitedServiceYARPCClient(params.Provider.ClientConfig(name), options...), 391 } 392 } 393 } 394 395 // FxExcitedServiceYARPCProceduresParams defines the input 396 // for NewFxExcitedServiceYARPCProcedures. It provides the 397 // paramaters to get ExcitedServiceYARPCServer procedures in an 398 // Fx application. 399 type FxExcitedServiceYARPCProceduresParams struct { 400 fx.In 401 402 Server ExcitedServiceYARPCServer 403 } 404 405 // FxExcitedServiceYARPCProceduresResult defines the output 406 // of NewFxExcitedServiceYARPCProcedures. It provides 407 // ExcitedServiceYARPCServer procedures to an Fx application. 408 // 409 // The procedures are provided to the "yarpcfx" value group. 410 // Dig 1.2 or newer must be used for this feature to work. 411 type FxExcitedServiceYARPCProceduresResult struct { 412 fx.Out 413 414 Procedures []transport.Procedure `group:"yarpcfx"` 415 } 416 417 // NewFxExcitedServiceYARPCProcedures provides ExcitedServiceYARPCServer procedures to an Fx application. 418 // It expects a ExcitedServiceYARPCServer to be present in the container. 419 // 420 // fx.Provide( 421 // foopb.NewFxExcitedServiceYARPCProcedures(), 422 // ... 423 // ) 424 func NewFxExcitedServiceYARPCProcedures() interface{} { 425 return func(params FxExcitedServiceYARPCProceduresParams) FxExcitedServiceYARPCProceduresResult { 426 return FxExcitedServiceYARPCProceduresResult{ 427 Procedures: BuildExcitedServiceYARPCProcedures(params.Server), 428 } 429 } 430 } 431 432 type _ExcitedServiceYARPCCaller struct { 433 streamClient protobuf.StreamClient 434 } 435 436 func (c *_ExcitedServiceYARPCCaller) Exclamation(ctx context.Context, request *ExclamationRequest, options ...yarpc.CallOption) (*ExclamationResponse, error) { 437 responseMessage, err := c.streamClient.Call(ctx, "Exclamation", request, newExcitedServiceServiceExclamationYARPCResponse, options...) 438 if responseMessage == nil { 439 return nil, err 440 } 441 response, ok := responseMessage.(*ExclamationResponse) 442 if !ok { 443 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationYARPCResponse, responseMessage) 444 } 445 return response, err 446 } 447 448 func (c *_ExcitedServiceYARPCCaller) ExclamationClientStream(ctx context.Context, options ...yarpc.CallOption) (ExcitedServiceServiceExclamationClientStreamYARPCClient, error) { 449 stream, err := c.streamClient.CallStream(ctx, "ExclamationClientStream", options...) 450 if err != nil { 451 return nil, err 452 } 453 return &_ExcitedServiceServiceExclamationClientStreamYARPCClient{stream: stream}, nil 454 } 455 456 func (c *_ExcitedServiceYARPCCaller) ExclamationServerStream(ctx context.Context, request *ExclamationRequest, options ...yarpc.CallOption) (ExcitedServiceServiceExclamationServerStreamYARPCClient, error) { 457 stream, err := c.streamClient.CallStream(ctx, "ExclamationServerStream", options...) 458 if err != nil { 459 return nil, err 460 } 461 if err := stream.Send(request); err != nil { 462 return nil, err 463 } 464 return &_ExcitedServiceServiceExclamationServerStreamYARPCClient{stream: stream}, nil 465 } 466 467 func (c *_ExcitedServiceYARPCCaller) ExclamationBidiStream(ctx context.Context, options ...yarpc.CallOption) (ExcitedServiceServiceExclamationBidiStreamYARPCClient, error) { 468 stream, err := c.streamClient.CallStream(ctx, "ExclamationBidiStream", options...) 469 if err != nil { 470 return nil, err 471 } 472 return &_ExcitedServiceServiceExclamationBidiStreamYARPCClient{stream: stream}, nil 473 } 474 475 type _ExcitedServiceYARPCHandler struct { 476 server ExcitedServiceYARPCServer 477 } 478 479 func (h *_ExcitedServiceYARPCHandler) Exclamation(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { 480 var request *ExclamationRequest 481 var ok bool 482 if requestMessage != nil { 483 request, ok = requestMessage.(*ExclamationRequest) 484 if !ok { 485 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationYARPCRequest, requestMessage) 486 } 487 } 488 response, err := h.server.Exclamation(ctx, request) 489 if response == nil { 490 return nil, err 491 } 492 return response, err 493 } 494 495 func (h *_ExcitedServiceYARPCHandler) ExclamationClientStream(serverStream *protobuf.ServerStream) error { 496 response, err := h.server.ExclamationClientStream(&_ExcitedServiceServiceExclamationClientStreamYARPCServer{serverStream: serverStream}) 497 if err != nil { 498 return err 499 } 500 return serverStream.Send(response) 501 } 502 503 func (h *_ExcitedServiceYARPCHandler) ExclamationServerStream(serverStream *protobuf.ServerStream) error { 504 requestMessage, err := serverStream.Receive(newExcitedServiceServiceExclamationServerStreamYARPCRequest) 505 if requestMessage == nil { 506 return err 507 } 508 509 request, ok := requestMessage.(*ExclamationRequest) 510 if !ok { 511 return protobuf.CastError(emptyExcitedServiceServiceExclamationServerStreamYARPCRequest, requestMessage) 512 } 513 return h.server.ExclamationServerStream(request, &_ExcitedServiceServiceExclamationServerStreamYARPCServer{serverStream: serverStream}) 514 } 515 516 func (h *_ExcitedServiceYARPCHandler) ExclamationBidiStream(serverStream *protobuf.ServerStream) error { 517 return h.server.ExclamationBidiStream(&_ExcitedServiceServiceExclamationBidiStreamYARPCServer{serverStream: serverStream}) 518 } 519 520 type _ExcitedServiceServiceExclamationClientStreamYARPCClient struct { 521 stream *protobuf.ClientStream 522 } 523 524 func (c *_ExcitedServiceServiceExclamationClientStreamYARPCClient) Context() context.Context { 525 return c.stream.Context() 526 } 527 528 func (c *_ExcitedServiceServiceExclamationClientStreamYARPCClient) Send(request *ExclamationRequest, options ...yarpc.StreamOption) error { 529 return c.stream.Send(request, options...) 530 } 531 532 func (c *_ExcitedServiceServiceExclamationClientStreamYARPCClient) CloseAndRecv(options ...yarpc.StreamOption) (*ExclamationResponse, error) { 533 if err := c.stream.Close(options...); err != nil { 534 return nil, err 535 } 536 responseMessage, err := c.stream.Receive(newExcitedServiceServiceExclamationClientStreamYARPCResponse, options...) 537 if responseMessage == nil { 538 return nil, err 539 } 540 response, ok := responseMessage.(*ExclamationResponse) 541 if !ok { 542 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationClientStreamYARPCResponse, responseMessage) 543 } 544 return response, err 545 } 546 547 type _ExcitedServiceServiceExclamationServerStreamYARPCClient struct { 548 stream *protobuf.ClientStream 549 } 550 551 func (c *_ExcitedServiceServiceExclamationServerStreamYARPCClient) Context() context.Context { 552 return c.stream.Context() 553 } 554 555 func (c *_ExcitedServiceServiceExclamationServerStreamYARPCClient) Recv(options ...yarpc.StreamOption) (*ExclamationResponse, error) { 556 responseMessage, err := c.stream.Receive(newExcitedServiceServiceExclamationServerStreamYARPCResponse, options...) 557 if responseMessage == nil { 558 return nil, err 559 } 560 response, ok := responseMessage.(*ExclamationResponse) 561 if !ok { 562 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationServerStreamYARPCResponse, responseMessage) 563 } 564 return response, err 565 } 566 567 func (c *_ExcitedServiceServiceExclamationServerStreamYARPCClient) CloseSend(options ...yarpc.StreamOption) error { 568 return c.stream.Close(options...) 569 } 570 571 type _ExcitedServiceServiceExclamationBidiStreamYARPCClient struct { 572 stream *protobuf.ClientStream 573 } 574 575 func (c *_ExcitedServiceServiceExclamationBidiStreamYARPCClient) Context() context.Context { 576 return c.stream.Context() 577 } 578 579 func (c *_ExcitedServiceServiceExclamationBidiStreamYARPCClient) Send(request *ExclamationRequest, options ...yarpc.StreamOption) error { 580 return c.stream.Send(request, options...) 581 } 582 583 func (c *_ExcitedServiceServiceExclamationBidiStreamYARPCClient) Recv(options ...yarpc.StreamOption) (*ExclamationResponse, error) { 584 responseMessage, err := c.stream.Receive(newExcitedServiceServiceExclamationBidiStreamYARPCResponse, options...) 585 if responseMessage == nil { 586 return nil, err 587 } 588 response, ok := responseMessage.(*ExclamationResponse) 589 if !ok { 590 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationBidiStreamYARPCResponse, responseMessage) 591 } 592 return response, err 593 } 594 595 func (c *_ExcitedServiceServiceExclamationBidiStreamYARPCClient) CloseSend(options ...yarpc.StreamOption) error { 596 return c.stream.Close(options...) 597 } 598 599 type _ExcitedServiceServiceExclamationClientStreamYARPCServer struct { 600 serverStream *protobuf.ServerStream 601 } 602 603 func (s *_ExcitedServiceServiceExclamationClientStreamYARPCServer) Context() context.Context { 604 return s.serverStream.Context() 605 } 606 607 func (s *_ExcitedServiceServiceExclamationClientStreamYARPCServer) Recv(options ...yarpc.StreamOption) (*ExclamationRequest, error) { 608 requestMessage, err := s.serverStream.Receive(newExcitedServiceServiceExclamationClientStreamYARPCRequest, options...) 609 if requestMessage == nil { 610 return nil, err 611 } 612 request, ok := requestMessage.(*ExclamationRequest) 613 if !ok { 614 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationClientStreamYARPCRequest, requestMessage) 615 } 616 return request, err 617 } 618 619 type _ExcitedServiceServiceExclamationServerStreamYARPCServer struct { 620 serverStream *protobuf.ServerStream 621 } 622 623 func (s *_ExcitedServiceServiceExclamationServerStreamYARPCServer) Context() context.Context { 624 return s.serverStream.Context() 625 } 626 627 func (s *_ExcitedServiceServiceExclamationServerStreamYARPCServer) Send(response *ExclamationResponse, options ...yarpc.StreamOption) error { 628 return s.serverStream.Send(response, options...) 629 } 630 631 type _ExcitedServiceServiceExclamationBidiStreamYARPCServer struct { 632 serverStream *protobuf.ServerStream 633 } 634 635 func (s *_ExcitedServiceServiceExclamationBidiStreamYARPCServer) Context() context.Context { 636 return s.serverStream.Context() 637 } 638 639 func (s *_ExcitedServiceServiceExclamationBidiStreamYARPCServer) Recv(options ...yarpc.StreamOption) (*ExclamationRequest, error) { 640 requestMessage, err := s.serverStream.Receive(newExcitedServiceServiceExclamationBidiStreamYARPCRequest, options...) 641 if requestMessage == nil { 642 return nil, err 643 } 644 request, ok := requestMessage.(*ExclamationRequest) 645 if !ok { 646 return nil, protobuf.CastError(emptyExcitedServiceServiceExclamationBidiStreamYARPCRequest, requestMessage) 647 } 648 return request, err 649 } 650 651 func (s *_ExcitedServiceServiceExclamationBidiStreamYARPCServer) Send(response *ExclamationResponse, options ...yarpc.StreamOption) error { 652 return s.serverStream.Send(response, options...) 653 } 654 655 func newExcitedServiceServiceExclamationYARPCRequest() proto.Message { 656 return &ExclamationRequest{} 657 } 658 659 func newExcitedServiceServiceExclamationYARPCResponse() proto.Message { 660 return &ExclamationResponse{} 661 } 662 663 func newExcitedServiceServiceExclamationClientStreamYARPCRequest() proto.Message { 664 return &ExclamationRequest{} 665 } 666 667 func newExcitedServiceServiceExclamationClientStreamYARPCResponse() proto.Message { 668 return &ExclamationResponse{} 669 } 670 671 func newExcitedServiceServiceExclamationServerStreamYARPCRequest() proto.Message { 672 return &ExclamationRequest{} 673 } 674 675 func newExcitedServiceServiceExclamationServerStreamYARPCResponse() proto.Message { 676 return &ExclamationResponse{} 677 } 678 679 func newExcitedServiceServiceExclamationBidiStreamYARPCRequest() proto.Message { 680 return &ExclamationRequest{} 681 } 682 683 func newExcitedServiceServiceExclamationBidiStreamYARPCResponse() proto.Message { 684 return &ExclamationResponse{} 685 } 686 687 var ( 688 emptyExcitedServiceServiceExclamationYARPCRequest = &ExclamationRequest{} 689 emptyExcitedServiceServiceExclamationYARPCResponse = &ExclamationResponse{} 690 emptyExcitedServiceServiceExclamationClientStreamYARPCRequest = &ExclamationRequest{} 691 emptyExcitedServiceServiceExclamationClientStreamYARPCResponse = &ExclamationResponse{} 692 emptyExcitedServiceServiceExclamationServerStreamYARPCRequest = &ExclamationRequest{} 693 emptyExcitedServiceServiceExclamationServerStreamYARPCResponse = &ExclamationResponse{} 694 emptyExcitedServiceServiceExclamationBidiStreamYARPCRequest = &ExclamationRequest{} 695 emptyExcitedServiceServiceExclamationBidiStreamYARPCResponse = &ExclamationResponse{} 696 ) 697 698 func init() { 699 yarpc.RegisterClientBuilder( 700 func(clientConfig transport.ClientConfig, structField reflect.StructField) HelloServiceYARPCClient { 701 return NewHelloServiceYARPCClient(clientConfig, protobuf.ClientBuilderOptions(clientConfig, structField)...) 702 }, 703 ) 704 yarpc.RegisterClientBuilder( 705 func(clientConfig transport.ClientConfig, structField reflect.StructField) ExcitedServiceYARPCClient { 706 return NewExcitedServiceYARPCClient(clientConfig, protobuf.ClientBuilderOptions(clientConfig, structField)...) 707 }, 708 ) 709 }