github.com/goravel/framework@v1.13.9/grpc/test.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: test/test.proto 3 4 package grpc 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 grpc "google.golang.org/grpc" 11 codes "google.golang.org/grpc/codes" 12 status "google.golang.org/grpc/status" 13 io "io" 14 math "math" 15 math_bits "math/bits" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the proto package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // proto package needs to be updated. 27 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 28 29 type TestRequest struct { 30 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 31 XXX_NoUnkeyedLiteral struct{} `json:"-"` 32 XXX_unrecognized []byte `json:"-"` 33 XXX_sizecache int32 `json:"-"` 34 } 35 36 func (m *TestRequest) Reset() { *m = TestRequest{} } 37 func (m *TestRequest) String() string { return proto.CompactTextString(m) } 38 func (*TestRequest) ProtoMessage() {} 39 func (*TestRequest) Descriptor() ([]byte, []int) { 40 return fileDescriptor_84eb23d74a64bdab, []int{0} 41 } 42 func (m *TestRequest) XXX_Unmarshal(b []byte) error { 43 return m.Unmarshal(b) 44 } 45 func (m *TestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 if deterministic { 47 return xxx_messageInfo_TestRequest.Marshal(b, m, deterministic) 48 } else { 49 b = b[:cap(b)] 50 n, err := m.MarshalToSizedBuffer(b) 51 if err != nil { 52 return nil, err 53 } 54 return b[:n], nil 55 } 56 } 57 func (m *TestRequest) XXX_Merge(src proto.Message) { 58 xxx_messageInfo_TestRequest.Merge(m, src) 59 } 60 func (m *TestRequest) XXX_Size() int { 61 return m.Size() 62 } 63 func (m *TestRequest) XXX_DiscardUnknown() { 64 xxx_messageInfo_TestRequest.DiscardUnknown(m) 65 } 66 67 var xxx_messageInfo_TestRequest proto.InternalMessageInfo 68 69 func (m *TestRequest) GetName() string { 70 if m != nil { 71 return m.Name 72 } 73 return "" 74 } 75 76 type TestResponse struct { 77 Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` 78 Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` 79 XXX_NoUnkeyedLiteral struct{} `json:"-"` 80 XXX_unrecognized []byte `json:"-"` 81 XXX_sizecache int32 `json:"-"` 82 } 83 84 func (m *TestResponse) Reset() { *m = TestResponse{} } 85 func (m *TestResponse) String() string { return proto.CompactTextString(m) } 86 func (*TestResponse) ProtoMessage() {} 87 func (*TestResponse) Descriptor() ([]byte, []int) { 88 return fileDescriptor_84eb23d74a64bdab, []int{1} 89 } 90 func (m *TestResponse) XXX_Unmarshal(b []byte) error { 91 return m.Unmarshal(b) 92 } 93 func (m *TestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 94 if deterministic { 95 return xxx_messageInfo_TestResponse.Marshal(b, m, deterministic) 96 } else { 97 b = b[:cap(b)] 98 n, err := m.MarshalToSizedBuffer(b) 99 if err != nil { 100 return nil, err 101 } 102 return b[:n], nil 103 } 104 } 105 func (m *TestResponse) XXX_Merge(src proto.Message) { 106 xxx_messageInfo_TestResponse.Merge(m, src) 107 } 108 func (m *TestResponse) XXX_Size() int { 109 return m.Size() 110 } 111 func (m *TestResponse) XXX_DiscardUnknown() { 112 xxx_messageInfo_TestResponse.DiscardUnknown(m) 113 } 114 115 var xxx_messageInfo_TestResponse proto.InternalMessageInfo 116 117 func (m *TestResponse) GetCode() int32 { 118 if m != nil { 119 return m.Code 120 } 121 return 0 122 } 123 124 func (m *TestResponse) GetMessage() string { 125 if m != nil { 126 return m.Message 127 } 128 return "" 129 } 130 131 func init() { 132 proto.RegisterType((*TestRequest)(nil), "protos.TestRequest") 133 proto.RegisterType((*TestResponse)(nil), "protos.TestResponse") 134 } 135 136 func init() { proto.RegisterFile("test/test.proto", fileDescriptor_84eb23d74a64bdab) } 137 138 var fileDescriptor_84eb23d74a64bdab = []byte{ 139 // 173 bytes of a gzipped FileDescriptorProto 140 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x49, 0x2d, 0x2e, 141 0xd1, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x6c, 0x60, 0xaa, 0x58, 0x49, 0x91, 142 0x8b, 0x3b, 0x24, 0xb5, 0xb8, 0x24, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x88, 0x8b, 143 0x25, 0x2f, 0x31, 0x37, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, 0x56, 0xb2, 0xe1, 144 0xe2, 0x81, 0x28, 0x29, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x05, 0xa9, 0x49, 0xce, 0x4f, 0x81, 0xa8, 145 0x61, 0x0d, 0x02, 0xb3, 0x85, 0x24, 0xb8, 0xd8, 0x73, 0x53, 0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x25, 146 0x98, 0xc0, 0x5a, 0x61, 0x5c, 0x23, 0x47, 0x88, 0x05, 0xc1, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 147 0x42, 0x46, 0x5c, 0xcc, 0xee, 0xa9, 0x25, 0x42, 0xc2, 0x10, 0x67, 0x14, 0xeb, 0x21, 0x59, 0x2e, 148 0x25, 0x82, 0x2a, 0x08, 0xb1, 0x4e, 0x89, 0xc1, 0x49, 0xe0, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 149 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf1, 0x58, 0x8e, 0x21, 0x09, 0xe2, 0x7a, 0x63, 0x40, 150 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0xf9, 0xec, 0xcf, 0xd7, 0x00, 0x00, 0x00, 151 } 152 153 // Reference imports to suppress errors if they are not otherwise used. 154 var _ context.Context 155 var _ grpc.ClientConn 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.SupportPackageIsVersion4 160 161 // TestServiceClient is the client API for TestService 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 TestServiceClient interface { 165 Get(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) 166 } 167 168 type testServiceClient struct { 169 cc *grpc.ClientConn 170 } 171 172 func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { 173 return &testServiceClient{cc} 174 } 175 176 func (c *testServiceClient) Get(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error) { 177 out := new(TestResponse) 178 err := c.cc.Invoke(ctx, "/protos.TestService/Get", in, out, opts...) 179 if err != nil { 180 return nil, err 181 } 182 return out, nil 183 } 184 185 // TestServiceServer is the server API for TestService service. 186 type TestServiceServer interface { 187 Get(context.Context, *TestRequest) (*TestResponse, error) 188 } 189 190 // UnimplementedTestServiceServer can be embedded to have forward compatible implementations. 191 type UnimplementedTestServiceServer struct { 192 } 193 194 func (*UnimplementedTestServiceServer) Get(ctx context.Context, req *TestRequest) (*TestResponse, error) { 195 return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") 196 } 197 198 func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { 199 s.RegisterService(&_TestService_serviceDesc, srv) 200 } 201 202 func _TestService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 203 in := new(TestRequest) 204 if err := dec(in); err != nil { 205 return nil, err 206 } 207 if interceptor == nil { 208 return srv.(TestServiceServer).Get(ctx, in) 209 } 210 info := &grpc.UnaryServerInfo{ 211 Server: srv, 212 FullMethod: "/protos.TestService/Get", 213 } 214 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 215 return srv.(TestServiceServer).Get(ctx, req.(*TestRequest)) 216 } 217 return interceptor(ctx, in, info, handler) 218 } 219 220 var _TestService_serviceDesc = grpc.ServiceDesc{ 221 ServiceName: "protos.TestService", 222 HandlerType: (*TestServiceServer)(nil), 223 Methods: []grpc.MethodDesc{ 224 { 225 MethodName: "Get", 226 Handler: _TestService_Get_Handler, 227 }, 228 }, 229 Streams: []grpc.StreamDesc{}, 230 Metadata: "test/test.proto", 231 } 232 233 func (m *TestRequest) Marshal() (dAtA []byte, err error) { 234 size := m.Size() 235 dAtA = make([]byte, size) 236 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 237 if err != nil { 238 return nil, err 239 } 240 return dAtA[:n], nil 241 } 242 243 func (m *TestRequest) MarshalTo(dAtA []byte) (int, error) { 244 size := m.Size() 245 return m.MarshalToSizedBuffer(dAtA[:size]) 246 } 247 248 func (m *TestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 249 i := len(dAtA) 250 _ = i 251 var l int 252 _ = l 253 if m.XXX_unrecognized != nil { 254 i -= len(m.XXX_unrecognized) 255 copy(dAtA[i:], m.XXX_unrecognized) 256 } 257 if len(m.Name) > 0 { 258 i -= len(m.Name) 259 copy(dAtA[i:], m.Name) 260 i = encodeVarintTest(dAtA, i, uint64(len(m.Name))) 261 i-- 262 dAtA[i] = 0xa 263 } 264 return len(dAtA) - i, nil 265 } 266 267 func (m *TestResponse) Marshal() (dAtA []byte, err error) { 268 size := m.Size() 269 dAtA = make([]byte, size) 270 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 271 if err != nil { 272 return nil, err 273 } 274 return dAtA[:n], nil 275 } 276 277 func (m *TestResponse) MarshalTo(dAtA []byte) (int, error) { 278 size := m.Size() 279 return m.MarshalToSizedBuffer(dAtA[:size]) 280 } 281 282 func (m *TestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 283 i := len(dAtA) 284 _ = i 285 var l int 286 _ = l 287 if m.XXX_unrecognized != nil { 288 i -= len(m.XXX_unrecognized) 289 copy(dAtA[i:], m.XXX_unrecognized) 290 } 291 if len(m.Message) > 0 { 292 i -= len(m.Message) 293 copy(dAtA[i:], m.Message) 294 i = encodeVarintTest(dAtA, i, uint64(len(m.Message))) 295 i-- 296 dAtA[i] = 0x12 297 } 298 if m.Code != 0 { 299 i = encodeVarintTest(dAtA, i, uint64(m.Code)) 300 i-- 301 dAtA[i] = 0x8 302 } 303 return len(dAtA) - i, nil 304 } 305 306 func encodeVarintTest(dAtA []byte, offset int, v uint64) int { 307 offset -= sovTest(v) 308 base := offset 309 for v >= 1<<7 { 310 dAtA[offset] = uint8(v&0x7f | 0x80) 311 v >>= 7 312 offset++ 313 } 314 dAtA[offset] = uint8(v) 315 return base 316 } 317 func (m *TestRequest) Size() (n int) { 318 if m == nil { 319 return 0 320 } 321 var l int 322 _ = l 323 l = len(m.Name) 324 if l > 0 { 325 n += 1 + l + sovTest(uint64(l)) 326 } 327 if m.XXX_unrecognized != nil { 328 n += len(m.XXX_unrecognized) 329 } 330 return n 331 } 332 333 func (m *TestResponse) Size() (n int) { 334 if m == nil { 335 return 0 336 } 337 var l int 338 _ = l 339 if m.Code != 0 { 340 n += 1 + sovTest(uint64(m.Code)) 341 } 342 l = len(m.Message) 343 if l > 0 { 344 n += 1 + l + sovTest(uint64(l)) 345 } 346 if m.XXX_unrecognized != nil { 347 n += len(m.XXX_unrecognized) 348 } 349 return n 350 } 351 352 func sovTest(x uint64) (n int) { 353 return (math_bits.Len64(x|1) + 6) / 7 354 } 355 func sozTest(x uint64) (n int) { 356 return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 357 } 358 func (m *TestRequest) Unmarshal(dAtA []byte) error { 359 l := len(dAtA) 360 iNdEx := 0 361 for iNdEx < l { 362 preIndex := iNdEx 363 var wire uint64 364 for shift := uint(0); ; shift += 7 { 365 if shift >= 64 { 366 return ErrIntOverflowTest 367 } 368 if iNdEx >= l { 369 return io.ErrUnexpectedEOF 370 } 371 b := dAtA[iNdEx] 372 iNdEx++ 373 wire |= uint64(b&0x7F) << shift 374 if b < 0x80 { 375 break 376 } 377 } 378 fieldNum := int32(wire >> 3) 379 wireType := int(wire & 0x7) 380 if wireType == 4 { 381 return fmt.Errorf("proto: TestRequest: wiretype end group for non-group") 382 } 383 if fieldNum <= 0 { 384 return fmt.Errorf("proto: TestRequest: illegal tag %d (wire type %d)", fieldNum, wire) 385 } 386 switch fieldNum { 387 case 1: 388 if wireType != 2 { 389 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 390 } 391 var stringLen uint64 392 for shift := uint(0); ; shift += 7 { 393 if shift >= 64 { 394 return ErrIntOverflowTest 395 } 396 if iNdEx >= l { 397 return io.ErrUnexpectedEOF 398 } 399 b := dAtA[iNdEx] 400 iNdEx++ 401 stringLen |= uint64(b&0x7F) << shift 402 if b < 0x80 { 403 break 404 } 405 } 406 intStringLen := int(stringLen) 407 if intStringLen < 0 { 408 return ErrInvalidLengthTest 409 } 410 postIndex := iNdEx + intStringLen 411 if postIndex < 0 { 412 return ErrInvalidLengthTest 413 } 414 if postIndex > l { 415 return io.ErrUnexpectedEOF 416 } 417 m.Name = string(dAtA[iNdEx:postIndex]) 418 iNdEx = postIndex 419 default: 420 iNdEx = preIndex 421 skippy, err := skipTest(dAtA[iNdEx:]) 422 if err != nil { 423 return err 424 } 425 if (skippy < 0) || (iNdEx+skippy) < 0 { 426 return ErrInvalidLengthTest 427 } 428 if (iNdEx + skippy) > l { 429 return io.ErrUnexpectedEOF 430 } 431 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 432 iNdEx += skippy 433 } 434 } 435 436 if iNdEx > l { 437 return io.ErrUnexpectedEOF 438 } 439 return nil 440 } 441 func (m *TestResponse) Unmarshal(dAtA []byte) error { 442 l := len(dAtA) 443 iNdEx := 0 444 for iNdEx < l { 445 preIndex := iNdEx 446 var wire uint64 447 for shift := uint(0); ; shift += 7 { 448 if shift >= 64 { 449 return ErrIntOverflowTest 450 } 451 if iNdEx >= l { 452 return io.ErrUnexpectedEOF 453 } 454 b := dAtA[iNdEx] 455 iNdEx++ 456 wire |= uint64(b&0x7F) << shift 457 if b < 0x80 { 458 break 459 } 460 } 461 fieldNum := int32(wire >> 3) 462 wireType := int(wire & 0x7) 463 if wireType == 4 { 464 return fmt.Errorf("proto: TestResponse: wiretype end group for non-group") 465 } 466 if fieldNum <= 0 { 467 return fmt.Errorf("proto: TestResponse: illegal tag %d (wire type %d)", fieldNum, wire) 468 } 469 switch fieldNum { 470 case 1: 471 if wireType != 0 { 472 return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) 473 } 474 m.Code = 0 475 for shift := uint(0); ; shift += 7 { 476 if shift >= 64 { 477 return ErrIntOverflowTest 478 } 479 if iNdEx >= l { 480 return io.ErrUnexpectedEOF 481 } 482 b := dAtA[iNdEx] 483 iNdEx++ 484 m.Code |= int32(b&0x7F) << shift 485 if b < 0x80 { 486 break 487 } 488 } 489 case 2: 490 if wireType != 2 { 491 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 492 } 493 var stringLen uint64 494 for shift := uint(0); ; shift += 7 { 495 if shift >= 64 { 496 return ErrIntOverflowTest 497 } 498 if iNdEx >= l { 499 return io.ErrUnexpectedEOF 500 } 501 b := dAtA[iNdEx] 502 iNdEx++ 503 stringLen |= uint64(b&0x7F) << shift 504 if b < 0x80 { 505 break 506 } 507 } 508 intStringLen := int(stringLen) 509 if intStringLen < 0 { 510 return ErrInvalidLengthTest 511 } 512 postIndex := iNdEx + intStringLen 513 if postIndex < 0 { 514 return ErrInvalidLengthTest 515 } 516 if postIndex > l { 517 return io.ErrUnexpectedEOF 518 } 519 m.Message = string(dAtA[iNdEx:postIndex]) 520 iNdEx = postIndex 521 default: 522 iNdEx = preIndex 523 skippy, err := skipTest(dAtA[iNdEx:]) 524 if err != nil { 525 return err 526 } 527 if (skippy < 0) || (iNdEx+skippy) < 0 { 528 return ErrInvalidLengthTest 529 } 530 if (iNdEx + skippy) > l { 531 return io.ErrUnexpectedEOF 532 } 533 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 534 iNdEx += skippy 535 } 536 } 537 538 if iNdEx > l { 539 return io.ErrUnexpectedEOF 540 } 541 return nil 542 } 543 func skipTest(dAtA []byte) (n int, err error) { 544 l := len(dAtA) 545 iNdEx := 0 546 depth := 0 547 for iNdEx < l { 548 var wire uint64 549 for shift := uint(0); ; shift += 7 { 550 if shift >= 64 { 551 return 0, ErrIntOverflowTest 552 } 553 if iNdEx >= l { 554 return 0, io.ErrUnexpectedEOF 555 } 556 b := dAtA[iNdEx] 557 iNdEx++ 558 wire |= (uint64(b) & 0x7F) << shift 559 if b < 0x80 { 560 break 561 } 562 } 563 wireType := int(wire & 0x7) 564 switch wireType { 565 case 0: 566 for shift := uint(0); ; shift += 7 { 567 if shift >= 64 { 568 return 0, ErrIntOverflowTest 569 } 570 if iNdEx >= l { 571 return 0, io.ErrUnexpectedEOF 572 } 573 iNdEx++ 574 if dAtA[iNdEx-1] < 0x80 { 575 break 576 } 577 } 578 case 1: 579 iNdEx += 8 580 case 2: 581 var length int 582 for shift := uint(0); ; shift += 7 { 583 if shift >= 64 { 584 return 0, ErrIntOverflowTest 585 } 586 if iNdEx >= l { 587 return 0, io.ErrUnexpectedEOF 588 } 589 b := dAtA[iNdEx] 590 iNdEx++ 591 length |= (int(b) & 0x7F) << shift 592 if b < 0x80 { 593 break 594 } 595 } 596 if length < 0 { 597 return 0, ErrInvalidLengthTest 598 } 599 iNdEx += length 600 case 3: 601 depth++ 602 case 4: 603 if depth == 0 { 604 return 0, ErrUnexpectedEndOfGroupTest 605 } 606 depth-- 607 case 5: 608 iNdEx += 4 609 default: 610 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 611 } 612 if iNdEx < 0 { 613 return 0, ErrInvalidLengthTest 614 } 615 if depth == 0 { 616 return iNdEx, nil 617 } 618 } 619 return 0, io.ErrUnexpectedEOF 620 } 621 622 var ( 623 ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling") 624 ErrIntOverflowTest = fmt.Errorf("proto: integer overflow") 625 ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group") 626 )