dubbo.apache.org/dubbo-go/v3@v3.1.1/protocol/grpc/internal/multiprotos/second.pb.go (about) 1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 // Code generated by protoc-gen-go. DO NOT EDIT. 19 // source: second.proto 20 21 package multiprotos 22 23 import ( 24 context "context" 25 fmt "fmt" 26 math "math" 27 ) 28 29 import ( 30 proto "github.com/golang/protobuf/proto" 31 32 grpc "google.golang.org/grpc" 33 codes "google.golang.org/grpc/codes" 34 status "google.golang.org/grpc/status" 35 ) 36 37 import ( 38 "dubbo.apache.org/dubbo-go/v3/protocol" 39 "dubbo.apache.org/dubbo-go/v3/protocol/invocation" 40 ) 41 42 // Reference imports to suppress errors if they are not otherwise used. 43 var _ = proto.Marshal 44 var _ = fmt.Errorf 45 var _ = math.Inf 46 47 // This is a compile-time assertion to ensure that this generated file 48 // is compatible with the proto package it is being compiled against. 49 // A compilation error at this line likely means your copy of the 50 // proto package needs to be updated. 51 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 52 53 type SecondRequest struct { 54 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 55 XXX_NoUnkeyedLiteral struct{} `json:"-"` 56 XXX_unrecognized []byte `json:"-"` 57 XXX_sizecache int32 `json:"-"` 58 } 59 60 func (m *SecondRequest) Reset() { *m = SecondRequest{} } 61 func (m *SecondRequest) String() string { return proto.CompactTextString(m) } 62 func (*SecondRequest) ProtoMessage() {} 63 func (*SecondRequest) Descriptor() ([]byte, []int) { 64 return fileDescriptor_83c4a0a7b0d4882f, []int{0} 65 } 66 67 func (m *SecondRequest) XXX_Unmarshal(b []byte) error { 68 return xxx_messageInfo_SecondRequest.Unmarshal(m, b) 69 } 70 func (m *SecondRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 71 return xxx_messageInfo_SecondRequest.Marshal(b, m, deterministic) 72 } 73 func (m *SecondRequest) XXX_Merge(src proto.Message) { 74 xxx_messageInfo_SecondRequest.Merge(m, src) 75 } 76 func (m *SecondRequest) XXX_Size() int { 77 return xxx_messageInfo_SecondRequest.Size(m) 78 } 79 func (m *SecondRequest) XXX_DiscardUnknown() { 80 xxx_messageInfo_SecondRequest.DiscardUnknown(m) 81 } 82 83 var xxx_messageInfo_SecondRequest proto.InternalMessageInfo 84 85 func (m *SecondRequest) GetMessage() string { 86 if m != nil { 87 return m.Message 88 } 89 return "" 90 } 91 92 type SecondResponse struct { 93 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 94 XXX_NoUnkeyedLiteral struct{} `json:"-"` 95 XXX_unrecognized []byte `json:"-"` 96 XXX_sizecache int32 `json:"-"` 97 } 98 99 func (m *SecondResponse) Reset() { *m = SecondResponse{} } 100 func (m *SecondResponse) String() string { return proto.CompactTextString(m) } 101 func (*SecondResponse) ProtoMessage() {} 102 func (*SecondResponse) Descriptor() ([]byte, []int) { 103 return fileDescriptor_83c4a0a7b0d4882f, []int{1} 104 } 105 106 func (m *SecondResponse) XXX_Unmarshal(b []byte) error { 107 return xxx_messageInfo_SecondResponse.Unmarshal(m, b) 108 } 109 func (m *SecondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 110 return xxx_messageInfo_SecondResponse.Marshal(b, m, deterministic) 111 } 112 func (m *SecondResponse) XXX_Merge(src proto.Message) { 113 xxx_messageInfo_SecondResponse.Merge(m, src) 114 } 115 func (m *SecondResponse) XXX_Size() int { 116 return xxx_messageInfo_SecondResponse.Size(m) 117 } 118 func (m *SecondResponse) XXX_DiscardUnknown() { 119 xxx_messageInfo_SecondResponse.DiscardUnknown(m) 120 } 121 122 var xxx_messageInfo_SecondResponse proto.InternalMessageInfo 123 124 func (m *SecondResponse) GetMessage() string { 125 if m != nil { 126 return m.Message 127 } 128 return "" 129 } 130 131 func init() { 132 proto.RegisterType((*SecondRequest)(nil), "multiprotos.SecondRequest") 133 proto.RegisterType((*SecondResponse)(nil), "multiprotos.SecondResponse") 134 } 135 136 func init() { proto.RegisterFile("second.proto", fileDescriptor_83c4a0a7b0d4882f) } 137 138 var fileDescriptor_83c4a0a7b0d4882f = []byte{ 139 // 163 bytes of a gzipped FileDescriptorProto 140 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4e, 0x4d, 0xce, 141 0xcf, 0x4b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x2d, 0xcd, 0x29, 0xc9, 0x04, 142 0xb3, 0x8b, 0x95, 0x34, 0xb9, 0x78, 0x83, 0xc1, 0x92, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 143 0x42, 0x12, 0x5c, 0xec, 0xb9, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 144 0x9c, 0x41, 0x30, 0xae, 0x92, 0x16, 0x17, 0x1f, 0x4c, 0x69, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0x2a, 145 0x6e, 0xb5, 0x46, 0x9b, 0x99, 0x60, 0xe6, 0x06, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x0a, 0xb9, 146 0x72, 0x71, 0x40, 0x99, 0x86, 0x42, 0x52, 0x7a, 0x48, 0x4e, 0xd0, 0x43, 0xb1, 0x5f, 0x4a, 0x1a, 147 0xab, 0x1c, 0xc4, 0x42, 0x25, 0x06, 0x21, 0x77, 0xb8, 0x31, 0x46, 0x14, 0x18, 0x63, 0xc0, 0x88, 148 0x64, 0x90, 0x31, 0x05, 0x06, 0x69, 0x30, 0x0a, 0x79, 0xc2, 0x0d, 0x32, 0xa1, 0xc8, 0x20, 0x03, 149 0xc6, 0x24, 0x36, 0xb0, 0xa4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xba, 0xd2, 0x28, 0xb0, 150 0x01, 0x00, 0x00, 151 } 152 153 // Reference imports to suppress errors if they are not otherwise used. 154 var _ context.Context 155 var _ grpc.ClientConnInterface 156 157 // This is a compile-time assertion to ensure that this generated file 158 // is compatible with the grpc package it is being compiled against. 159 const _ = grpc.SupportPackageIsVersion6 160 161 // SecondServiceClient is the client API for SecondService service. 162 // 163 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 164 type SecondServiceClient interface { 165 Service1(ctx context.Context, in *SecondRequest, opts ...grpc.CallOption) (*SecondResponse, error) 166 Service2(ctx context.Context, in *SecondRequest, opts ...grpc.CallOption) (SecondService_Service2Client, error) 167 Service3(ctx context.Context, opts ...grpc.CallOption) (SecondService_Service3Client, error) 168 Service4(ctx context.Context, opts ...grpc.CallOption) (SecondService_Service4Client, error) 169 } 170 171 type secondServiceClient struct { 172 cc grpc.ClientConnInterface 173 } 174 175 func NewSecondServiceClient(cc grpc.ClientConnInterface) SecondServiceClient { 176 return &secondServiceClient{cc} 177 } 178 179 func (c *secondServiceClient) Service1(ctx context.Context, in *SecondRequest, opts ...grpc.CallOption) (*SecondResponse, error) { 180 out := new(SecondResponse) 181 err := c.cc.Invoke(ctx, "/multiprotos.SecondService/Service1", in, out, opts...) 182 if err != nil { 183 return nil, err 184 } 185 return out, nil 186 } 187 188 func (c *secondServiceClient) Service2(ctx context.Context, in *SecondRequest, opts ...grpc.CallOption) (SecondService_Service2Client, error) { 189 stream, err := c.cc.NewStream(ctx, &_SecondService_serviceDesc.Streams[0], "/multiprotos.SecondService/Service2", opts...) 190 if err != nil { 191 return nil, err 192 } 193 x := &secondServiceService2Client{stream} 194 if err := x.ClientStream.SendMsg(in); err != nil { 195 return nil, err 196 } 197 if err := x.ClientStream.CloseSend(); err != nil { 198 return nil, err 199 } 200 return x, nil 201 } 202 203 type SecondService_Service2Client interface { 204 Recv() (*SecondResponse, error) 205 grpc.ClientStream 206 } 207 208 type secondServiceService2Client struct { 209 grpc.ClientStream 210 } 211 212 func (x *secondServiceService2Client) Recv() (*SecondResponse, error) { 213 m := new(SecondResponse) 214 if err := x.ClientStream.RecvMsg(m); err != nil { 215 return nil, err 216 } 217 return m, nil 218 } 219 220 func (c *secondServiceClient) Service3(ctx context.Context, opts ...grpc.CallOption) (SecondService_Service3Client, error) { 221 stream, err := c.cc.NewStream(ctx, &_SecondService_serviceDesc.Streams[1], "/multiprotos.SecondService/Service3", opts...) 222 if err != nil { 223 return nil, err 224 } 225 x := &secondServiceService3Client{stream} 226 return x, nil 227 } 228 229 type SecondService_Service3Client interface { 230 Send(*SecondRequest) error 231 CloseAndRecv() (*SecondResponse, error) 232 grpc.ClientStream 233 } 234 235 type secondServiceService3Client struct { 236 grpc.ClientStream 237 } 238 239 func (x *secondServiceService3Client) Send(m *SecondRequest) error { 240 return x.ClientStream.SendMsg(m) 241 } 242 243 func (x *secondServiceService3Client) CloseAndRecv() (*SecondResponse, error) { 244 if err := x.ClientStream.CloseSend(); err != nil { 245 return nil, err 246 } 247 m := new(SecondResponse) 248 if err := x.ClientStream.RecvMsg(m); err != nil { 249 return nil, err 250 } 251 return m, nil 252 } 253 254 func (c *secondServiceClient) Service4(ctx context.Context, opts ...grpc.CallOption) (SecondService_Service4Client, error) { 255 stream, err := c.cc.NewStream(ctx, &_SecondService_serviceDesc.Streams[2], "/multiprotos.SecondService/Service4", opts...) 256 if err != nil { 257 return nil, err 258 } 259 x := &secondServiceService4Client{stream} 260 return x, nil 261 } 262 263 type SecondService_Service4Client interface { 264 Send(*SecondRequest) error 265 Recv() (*SecondResponse, error) 266 grpc.ClientStream 267 } 268 269 type secondServiceService4Client struct { 270 grpc.ClientStream 271 } 272 273 func (x *secondServiceService4Client) Send(m *SecondRequest) error { 274 return x.ClientStream.SendMsg(m) 275 } 276 277 func (x *secondServiceService4Client) Recv() (*SecondResponse, error) { 278 m := new(SecondResponse) 279 if err := x.ClientStream.RecvMsg(m); err != nil { 280 return nil, err 281 } 282 return m, nil 283 } 284 285 // SecondServiceServer is the server API for SecondService service. 286 type SecondServiceServer interface { 287 Service1(context.Context, *SecondRequest) (*SecondResponse, error) 288 Service2(*SecondRequest, SecondService_Service2Server) error 289 Service3(SecondService_Service3Server) error 290 Service4(SecondService_Service4Server) error 291 } 292 293 // UnimplementedSecondServiceServer can be embedded to have forward compatible implementations. 294 type UnimplementedSecondServiceServer struct { 295 } 296 297 func (*UnimplementedSecondServiceServer) Service1(ctx context.Context, req *SecondRequest) (*SecondResponse, error) { 298 return nil, status.Errorf(codes.Unimplemented, "method Service1 not implemented") 299 } 300 func (*UnimplementedSecondServiceServer) Service2(req *SecondRequest, srv SecondService_Service2Server) error { 301 return status.Errorf(codes.Unimplemented, "method Service2 not implemented") 302 } 303 func (*UnimplementedSecondServiceServer) Service3(srv SecondService_Service3Server) error { 304 return status.Errorf(codes.Unimplemented, "method Service3 not implemented") 305 } 306 func (*UnimplementedSecondServiceServer) Service4(srv SecondService_Service4Server) error { 307 return status.Errorf(codes.Unimplemented, "method Service4 not implemented") 308 } 309 310 func RegisterSecondServiceServer(s *grpc.Server, srv SecondServiceServer) { 311 s.RegisterService(&_SecondService_serviceDesc, srv) 312 } 313 314 func _SecondService_Service1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 315 in := new(SecondRequest) 316 if err := dec(in); err != nil { 317 return nil, err 318 } 319 if interceptor == nil { 320 return srv.(SecondServiceServer).Service1(ctx, in) 321 } 322 info := &grpc.UnaryServerInfo{ 323 Server: srv, 324 FullMethod: "/multiprotos.SecondService/Service1", 325 } 326 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 327 return srv.(SecondServiceServer).Service1(ctx, req.(*SecondRequest)) 328 } 329 return interceptor(ctx, in, info, handler) 330 } 331 332 func _SecondService_Service2_Handler(srv interface{}, stream grpc.ServerStream) error { 333 m := new(SecondRequest) 334 if err := stream.RecvMsg(m); err != nil { 335 return err 336 } 337 return srv.(SecondServiceServer).Service2(m, &secondServiceService2Server{stream}) 338 } 339 340 type SecondService_Service2Server interface { 341 Send(*SecondResponse) error 342 grpc.ServerStream 343 } 344 345 type secondServiceService2Server struct { 346 grpc.ServerStream 347 } 348 349 func (x *secondServiceService2Server) Send(m *SecondResponse) error { 350 return x.ServerStream.SendMsg(m) 351 } 352 353 func _SecondService_Service3_Handler(srv interface{}, stream grpc.ServerStream) error { 354 return srv.(SecondServiceServer).Service3(&secondServiceService3Server{stream}) 355 } 356 357 type SecondService_Service3Server interface { 358 SendAndClose(*SecondResponse) error 359 Recv() (*SecondRequest, error) 360 grpc.ServerStream 361 } 362 363 type secondServiceService3Server struct { 364 grpc.ServerStream 365 } 366 367 func (x *secondServiceService3Server) SendAndClose(m *SecondResponse) error { 368 return x.ServerStream.SendMsg(m) 369 } 370 371 func (x *secondServiceService3Server) Recv() (*SecondRequest, error) { 372 m := new(SecondRequest) 373 if err := x.ServerStream.RecvMsg(m); err != nil { 374 return nil, err 375 } 376 return m, nil 377 } 378 379 func _SecondService_Service4_Handler(srv interface{}, stream grpc.ServerStream) error { 380 return srv.(SecondServiceServer).Service4(&secondServiceService4Server{stream}) 381 } 382 383 type SecondService_Service4Server interface { 384 Send(*SecondResponse) error 385 Recv() (*SecondRequest, error) 386 grpc.ServerStream 387 } 388 389 type secondServiceService4Server struct { 390 grpc.ServerStream 391 } 392 393 func (x *secondServiceService4Server) Send(m *SecondResponse) error { 394 return x.ServerStream.SendMsg(m) 395 } 396 397 func (x *secondServiceService4Server) Recv() (*SecondRequest, error) { 398 m := new(SecondRequest) 399 if err := x.ServerStream.RecvMsg(m); err != nil { 400 return nil, err 401 } 402 return m, nil 403 } 404 405 var _SecondService_serviceDesc = grpc.ServiceDesc{ 406 ServiceName: "multiprotos.SecondService", 407 HandlerType: (*SecondServiceServer)(nil), 408 Methods: []grpc.MethodDesc{ 409 { 410 MethodName: "Service1", 411 Handler: _SecondService_Service1_Handler, 412 }, 413 }, 414 Streams: []grpc.StreamDesc{ 415 { 416 StreamName: "Service2", 417 Handler: _SecondService_Service2_Handler, 418 ServerStreams: true, 419 }, 420 { 421 StreamName: "Service3", 422 Handler: _SecondService_Service3_Handler, 423 ClientStreams: true, 424 }, 425 { 426 StreamName: "Service4", 427 Handler: _SecondService_Service4_Handler, 428 ServerStreams: true, 429 ClientStreams: true, 430 }, 431 }, 432 Metadata: "second.proto", 433 } 434 435 // SecondServiceClientImpl is the client API for SecondService service. 436 // 437 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 438 type SecondServiceClientImpl struct { 439 Service1 func(ctx context.Context, in *SecondRequest, out *SecondResponse) error 440 Service2 func(ctx context.Context, in *SecondRequest) (SecondService_Service2Client, error) 441 Service3 func(ctx context.Context) (SecondService_Service3Client, error) 442 Service4 func(ctx context.Context) (SecondService_Service4Client, error) 443 } 444 445 func (c *SecondServiceClientImpl) Reference() string { 446 return "secondServiceImpl" 447 } 448 449 func (c *SecondServiceClientImpl) GetDubboStub(cc *grpc.ClientConn) SecondServiceClient { 450 return NewSecondServiceClient(cc) 451 } 452 453 type SecondServiceProviderBase struct { 454 proxyImpl protocol.Invoker 455 } 456 457 func (s *SecondServiceProviderBase) SetProxyImpl(impl protocol.Invoker) { 458 s.proxyImpl = impl 459 } 460 461 func (s *SecondServiceProviderBase) GetProxyImpl() protocol.Invoker { 462 return s.proxyImpl 463 } 464 465 func (c *SecondServiceProviderBase) Reference() string { 466 return "secondServiceImpl" 467 } 468 469 func _DUBBO_SecondService_Service1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 470 in := new(SecondRequest) 471 if err := dec(in); err != nil { 472 return nil, err 473 } 474 // DubboGrpcService is gRPC service 475 type DubboGrpcService interface { 476 // SetProxyImpl sets proxy. 477 SetProxyImpl(impl protocol.Invoker) 478 // GetProxyImpl gets proxy. 479 GetProxyImpl() protocol.Invoker 480 // ServiceDesc gets an RPC service's specification. 481 ServiceDesc() *grpc.ServiceDesc 482 } 483 base := srv.(DubboGrpcService) 484 args := []interface{}{} 485 args = append(args, in) 486 invo := invocation.NewRPCInvocation("Service1", args, nil) 487 if interceptor == nil { 488 result := base.GetProxyImpl().Invoke(ctx, invo) 489 return result.Result(), result.Error() 490 } 491 info := &grpc.UnaryServerInfo{ 492 Server: srv, 493 FullMethod: "/multiprotos.SecondService/Service1", 494 } 495 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 496 result := base.GetProxyImpl().Invoke(ctx, invo) 497 return result.Result(), result.Error() 498 } 499 return interceptor(ctx, in, info, handler) 500 } 501 502 func _DUBBO_SecondService_Service2_Handler(srv interface{}, stream grpc.ServerStream) error { 503 // DubboGrpcService is gRPC service 504 type DubboGrpcService interface { 505 // SetProxyImpl sets proxy. 506 SetProxyImpl(impl protocol.Invoker) 507 // GetProxyImpl gets proxy. 508 GetProxyImpl() protocol.Invoker 509 // ServiceDesc gets an RPC service's specification. 510 ServiceDesc() *grpc.ServiceDesc 511 } 512 _, ok := srv.(DubboGrpcService) 513 invo := invocation.NewRPCInvocation("Service2", nil, nil) 514 if !ok { 515 fmt.Println(invo) 516 } 517 m := new(SecondRequest) 518 if err := stream.RecvMsg(m); err != nil { 519 return err 520 } 521 return srv.(SecondServiceServer).Service2(m, &secondServiceService2Server{stream}) 522 } 523 524 func _DUBBO_SecondService_Service3_Handler(srv interface{}, stream grpc.ServerStream) error { 525 // DubboGrpcService is gRPC service 526 type DubboGrpcService interface { 527 // SetProxyImpl sets proxy. 528 SetProxyImpl(impl protocol.Invoker) 529 // GetProxyImpl gets proxy. 530 GetProxyImpl() protocol.Invoker 531 // ServiceDesc gets an RPC service's specification. 532 ServiceDesc() *grpc.ServiceDesc 533 } 534 _, ok := srv.(DubboGrpcService) 535 invo := invocation.NewRPCInvocation("Service3", nil, nil) 536 if !ok { 537 fmt.Println(invo) 538 } 539 return srv.(SecondServiceServer).Service3(&secondServiceService3Server{stream}) 540 } 541 542 func _DUBBO_SecondService_Service4_Handler(srv interface{}, stream grpc.ServerStream) error { 543 // DubboGrpcService is gRPC service 544 type DubboGrpcService interface { 545 // SetProxyImpl sets proxy. 546 SetProxyImpl(impl protocol.Invoker) 547 // GetProxyImpl gets proxy. 548 GetProxyImpl() protocol.Invoker 549 // ServiceDesc gets an RPC service's specification. 550 ServiceDesc() *grpc.ServiceDesc 551 } 552 _, ok := srv.(DubboGrpcService) 553 invo := invocation.NewRPCInvocation("Service4", nil, nil) 554 if !ok { 555 fmt.Println(invo) 556 } 557 return srv.(SecondServiceServer).Service4(&secondServiceService4Server{stream}) 558 } 559 560 func (s *SecondServiceProviderBase) ServiceDesc() *grpc.ServiceDesc { 561 return &grpc.ServiceDesc{ 562 ServiceName: "multiprotos.SecondService", 563 HandlerType: (*SecondServiceServer)(nil), 564 Methods: []grpc.MethodDesc{ 565 { 566 MethodName: "Service1", 567 Handler: _DUBBO_SecondService_Service1_Handler, 568 }, 569 }, 570 Streams: []grpc.StreamDesc{ 571 { 572 StreamName: "Service2", 573 Handler: _DUBBO_SecondService_Service2_Handler, 574 ServerStreams: true, 575 }, 576 { 577 StreamName: "Service3", 578 Handler: _DUBBO_SecondService_Service3_Handler, 579 ClientStreams: true, 580 }, 581 { 582 StreamName: "Service4", 583 Handler: _DUBBO_SecondService_Service4_Handler, 584 ServerStreams: true, 585 ClientStreams: true, 586 }, 587 }, 588 Metadata: "second.proto", 589 } 590 }