github.com/grafana/pyroscope@v1.18.0/pkg/util/httpgrpc/httpgrpc_vtproto.pb.go (about) 1 // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. 2 // protoc-gen-go-vtproto version: v0.6.0 3 // source: util/httpgrpc/httpgrpc.proto 4 5 package httpgrpc 6 7 import ( 8 context "context" 9 fmt "fmt" 10 protohelpers "github.com/planetscale/vtprotobuf/protohelpers" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 15 io "io" 16 ) 17 18 const ( 19 // Verify that this generated code is sufficiently up-to-date. 20 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 21 // Verify that runtime/protoimpl is sufficiently up-to-date. 22 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 23 ) 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the grpc package it is being compiled against. 27 // Requires gRPC-Go v1.32.0 or later. 28 const _ = grpc.SupportPackageIsVersion7 29 30 // HTTPClient is the client API for HTTP service. 31 // 32 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 33 type HTTPClient interface { 34 Handle(ctx context.Context, in *HTTPRequest, opts ...grpc.CallOption) (*HTTPResponse, error) 35 } 36 37 type hTTPClient struct { 38 cc grpc.ClientConnInterface 39 } 40 41 func NewHTTPClient(cc grpc.ClientConnInterface) HTTPClient { 42 return &hTTPClient{cc} 43 } 44 45 func (c *hTTPClient) Handle(ctx context.Context, in *HTTPRequest, opts ...grpc.CallOption) (*HTTPResponse, error) { 46 out := new(HTTPResponse) 47 err := c.cc.Invoke(ctx, "/httpgrpc.HTTP/Handle", in, out, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return out, nil 52 } 53 54 // HTTPServer is the server API for HTTP service. 55 // All implementations must embed UnimplementedHTTPServer 56 // for forward compatibility 57 type HTTPServer interface { 58 Handle(context.Context, *HTTPRequest) (*HTTPResponse, error) 59 mustEmbedUnimplementedHTTPServer() 60 } 61 62 // UnimplementedHTTPServer must be embedded to have forward compatible implementations. 63 type UnimplementedHTTPServer struct { 64 } 65 66 func (UnimplementedHTTPServer) Handle(context.Context, *HTTPRequest) (*HTTPResponse, error) { 67 return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") 68 } 69 func (UnimplementedHTTPServer) mustEmbedUnimplementedHTTPServer() {} 70 71 // UnsafeHTTPServer may be embedded to opt out of forward compatibility for this service. 72 // Use of this interface is not recommended, as added methods to HTTPServer will 73 // result in compilation errors. 74 type UnsafeHTTPServer interface { 75 mustEmbedUnimplementedHTTPServer() 76 } 77 78 func RegisterHTTPServer(s grpc.ServiceRegistrar, srv HTTPServer) { 79 s.RegisterService(&HTTP_ServiceDesc, srv) 80 } 81 82 func _HTTP_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 83 in := new(HTTPRequest) 84 if err := dec(in); err != nil { 85 return nil, err 86 } 87 if interceptor == nil { 88 return srv.(HTTPServer).Handle(ctx, in) 89 } 90 info := &grpc.UnaryServerInfo{ 91 Server: srv, 92 FullMethod: "/httpgrpc.HTTP/Handle", 93 } 94 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 95 return srv.(HTTPServer).Handle(ctx, req.(*HTTPRequest)) 96 } 97 return interceptor(ctx, in, info, handler) 98 } 99 100 // HTTP_ServiceDesc is the grpc.ServiceDesc for HTTP service. 101 // It's only intended for direct use with grpc.RegisterService, 102 // and not to be introspected or modified (even as a copy) 103 var HTTP_ServiceDesc = grpc.ServiceDesc{ 104 ServiceName: "httpgrpc.HTTP", 105 HandlerType: (*HTTPServer)(nil), 106 Methods: []grpc.MethodDesc{ 107 { 108 MethodName: "Handle", 109 Handler: _HTTP_Handle_Handler, 110 }, 111 }, 112 Streams: []grpc.StreamDesc{}, 113 Metadata: "util/httpgrpc/httpgrpc.proto", 114 } 115 116 func (m *HTTPRequest) MarshalVT() (dAtA []byte, err error) { 117 if m == nil { 118 return nil, nil 119 } 120 size := m.SizeVT() 121 dAtA = make([]byte, size) 122 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 123 if err != nil { 124 return nil, err 125 } 126 return dAtA[:n], nil 127 } 128 129 func (m *HTTPRequest) MarshalToVT(dAtA []byte) (int, error) { 130 size := m.SizeVT() 131 return m.MarshalToSizedBufferVT(dAtA[:size]) 132 } 133 134 func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 135 if m == nil { 136 return 0, nil 137 } 138 i := len(dAtA) 139 _ = i 140 var l int 141 _ = l 142 if m.unknownFields != nil { 143 i -= len(m.unknownFields) 144 copy(dAtA[i:], m.unknownFields) 145 } 146 if len(m.Body) > 0 { 147 i -= len(m.Body) 148 copy(dAtA[i:], m.Body) 149 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) 150 i-- 151 dAtA[i] = 0x22 152 } 153 if len(m.Headers) > 0 { 154 for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { 155 size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) 156 if err != nil { 157 return 0, err 158 } 159 i -= size 160 i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) 161 i-- 162 dAtA[i] = 0x1a 163 } 164 } 165 if len(m.Url) > 0 { 166 i -= len(m.Url) 167 copy(dAtA[i:], m.Url) 168 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Url))) 169 i-- 170 dAtA[i] = 0x12 171 } 172 if len(m.Method) > 0 { 173 i -= len(m.Method) 174 copy(dAtA[i:], m.Method) 175 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Method))) 176 i-- 177 dAtA[i] = 0xa 178 } 179 return len(dAtA) - i, nil 180 } 181 182 func (m *HTTPResponse) MarshalVT() (dAtA []byte, err error) { 183 if m == nil { 184 return nil, nil 185 } 186 size := m.SizeVT() 187 dAtA = make([]byte, size) 188 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 189 if err != nil { 190 return nil, err 191 } 192 return dAtA[:n], nil 193 } 194 195 func (m *HTTPResponse) MarshalToVT(dAtA []byte) (int, error) { 196 size := m.SizeVT() 197 return m.MarshalToSizedBufferVT(dAtA[:size]) 198 } 199 200 func (m *HTTPResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 201 if m == nil { 202 return 0, nil 203 } 204 i := len(dAtA) 205 _ = i 206 var l int 207 _ = l 208 if m.unknownFields != nil { 209 i -= len(m.unknownFields) 210 copy(dAtA[i:], m.unknownFields) 211 } 212 if len(m.Body) > 0 { 213 i -= len(m.Body) 214 copy(dAtA[i:], m.Body) 215 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) 216 i-- 217 dAtA[i] = 0x1a 218 } 219 if len(m.Headers) > 0 { 220 for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { 221 size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) 222 if err != nil { 223 return 0, err 224 } 225 i -= size 226 i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) 227 i-- 228 dAtA[i] = 0x12 229 } 230 } 231 if m.Code != 0 { 232 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) 233 i-- 234 dAtA[i] = 0x8 235 } 236 return len(dAtA) - i, nil 237 } 238 239 func (m *Header) MarshalVT() (dAtA []byte, err error) { 240 if m == nil { 241 return nil, nil 242 } 243 size := m.SizeVT() 244 dAtA = make([]byte, size) 245 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 246 if err != nil { 247 return nil, err 248 } 249 return dAtA[:n], nil 250 } 251 252 func (m *Header) MarshalToVT(dAtA []byte) (int, error) { 253 size := m.SizeVT() 254 return m.MarshalToSizedBufferVT(dAtA[:size]) 255 } 256 257 func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 258 if m == nil { 259 return 0, nil 260 } 261 i := len(dAtA) 262 _ = i 263 var l int 264 _ = l 265 if m.unknownFields != nil { 266 i -= len(m.unknownFields) 267 copy(dAtA[i:], m.unknownFields) 268 } 269 if len(m.Values) > 0 { 270 for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { 271 i -= len(m.Values[iNdEx]) 272 copy(dAtA[i:], m.Values[iNdEx]) 273 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) 274 i-- 275 dAtA[i] = 0x12 276 } 277 } 278 if len(m.Key) > 0 { 279 i -= len(m.Key) 280 copy(dAtA[i:], m.Key) 281 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) 282 i-- 283 dAtA[i] = 0xa 284 } 285 return len(dAtA) - i, nil 286 } 287 288 func (m *HTTPRequest) SizeVT() (n int) { 289 if m == nil { 290 return 0 291 } 292 var l int 293 _ = l 294 l = len(m.Method) 295 if l > 0 { 296 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 297 } 298 l = len(m.Url) 299 if l > 0 { 300 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 301 } 302 if len(m.Headers) > 0 { 303 for _, e := range m.Headers { 304 l = e.SizeVT() 305 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 306 } 307 } 308 l = len(m.Body) 309 if l > 0 { 310 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 311 } 312 n += len(m.unknownFields) 313 return n 314 } 315 316 func (m *HTTPResponse) SizeVT() (n int) { 317 if m == nil { 318 return 0 319 } 320 var l int 321 _ = l 322 if m.Code != 0 { 323 n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) 324 } 325 if len(m.Headers) > 0 { 326 for _, e := range m.Headers { 327 l = e.SizeVT() 328 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 329 } 330 } 331 l = len(m.Body) 332 if l > 0 { 333 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 334 } 335 n += len(m.unknownFields) 336 return n 337 } 338 339 func (m *Header) SizeVT() (n int) { 340 if m == nil { 341 return 0 342 } 343 var l int 344 _ = l 345 l = len(m.Key) 346 if l > 0 { 347 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 348 } 349 if len(m.Values) > 0 { 350 for _, s := range m.Values { 351 l = len(s) 352 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 353 } 354 } 355 n += len(m.unknownFields) 356 return n 357 } 358 359 func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { 360 l := len(dAtA) 361 iNdEx := 0 362 for iNdEx < l { 363 preIndex := iNdEx 364 var wire uint64 365 for shift := uint(0); ; shift += 7 { 366 if shift >= 64 { 367 return protohelpers.ErrIntOverflow 368 } 369 if iNdEx >= l { 370 return io.ErrUnexpectedEOF 371 } 372 b := dAtA[iNdEx] 373 iNdEx++ 374 wire |= uint64(b&0x7F) << shift 375 if b < 0x80 { 376 break 377 } 378 } 379 fieldNum := int32(wire >> 3) 380 wireType := int(wire & 0x7) 381 if wireType == 4 { 382 return fmt.Errorf("proto: HTTPRequest: wiretype end group for non-group") 383 } 384 if fieldNum <= 0 { 385 return fmt.Errorf("proto: HTTPRequest: illegal tag %d (wire type %d)", fieldNum, wire) 386 } 387 switch fieldNum { 388 case 1: 389 if wireType != 2 { 390 return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) 391 } 392 var stringLen uint64 393 for shift := uint(0); ; shift += 7 { 394 if shift >= 64 { 395 return protohelpers.ErrIntOverflow 396 } 397 if iNdEx >= l { 398 return io.ErrUnexpectedEOF 399 } 400 b := dAtA[iNdEx] 401 iNdEx++ 402 stringLen |= uint64(b&0x7F) << shift 403 if b < 0x80 { 404 break 405 } 406 } 407 intStringLen := int(stringLen) 408 if intStringLen < 0 { 409 return protohelpers.ErrInvalidLength 410 } 411 postIndex := iNdEx + intStringLen 412 if postIndex < 0 { 413 return protohelpers.ErrInvalidLength 414 } 415 if postIndex > l { 416 return io.ErrUnexpectedEOF 417 } 418 m.Method = string(dAtA[iNdEx:postIndex]) 419 iNdEx = postIndex 420 case 2: 421 if wireType != 2 { 422 return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) 423 } 424 var stringLen uint64 425 for shift := uint(0); ; shift += 7 { 426 if shift >= 64 { 427 return protohelpers.ErrIntOverflow 428 } 429 if iNdEx >= l { 430 return io.ErrUnexpectedEOF 431 } 432 b := dAtA[iNdEx] 433 iNdEx++ 434 stringLen |= uint64(b&0x7F) << shift 435 if b < 0x80 { 436 break 437 } 438 } 439 intStringLen := int(stringLen) 440 if intStringLen < 0 { 441 return protohelpers.ErrInvalidLength 442 } 443 postIndex := iNdEx + intStringLen 444 if postIndex < 0 { 445 return protohelpers.ErrInvalidLength 446 } 447 if postIndex > l { 448 return io.ErrUnexpectedEOF 449 } 450 m.Url = string(dAtA[iNdEx:postIndex]) 451 iNdEx = postIndex 452 case 3: 453 if wireType != 2 { 454 return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) 455 } 456 var msglen int 457 for shift := uint(0); ; shift += 7 { 458 if shift >= 64 { 459 return protohelpers.ErrIntOverflow 460 } 461 if iNdEx >= l { 462 return io.ErrUnexpectedEOF 463 } 464 b := dAtA[iNdEx] 465 iNdEx++ 466 msglen |= int(b&0x7F) << shift 467 if b < 0x80 { 468 break 469 } 470 } 471 if msglen < 0 { 472 return protohelpers.ErrInvalidLength 473 } 474 postIndex := iNdEx + msglen 475 if postIndex < 0 { 476 return protohelpers.ErrInvalidLength 477 } 478 if postIndex > l { 479 return io.ErrUnexpectedEOF 480 } 481 m.Headers = append(m.Headers, &Header{}) 482 if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { 483 return err 484 } 485 iNdEx = postIndex 486 case 4: 487 if wireType != 2 { 488 return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) 489 } 490 var byteLen int 491 for shift := uint(0); ; shift += 7 { 492 if shift >= 64 { 493 return protohelpers.ErrIntOverflow 494 } 495 if iNdEx >= l { 496 return io.ErrUnexpectedEOF 497 } 498 b := dAtA[iNdEx] 499 iNdEx++ 500 byteLen |= int(b&0x7F) << shift 501 if b < 0x80 { 502 break 503 } 504 } 505 if byteLen < 0 { 506 return protohelpers.ErrInvalidLength 507 } 508 postIndex := iNdEx + byteLen 509 if postIndex < 0 { 510 return protohelpers.ErrInvalidLength 511 } 512 if postIndex > l { 513 return io.ErrUnexpectedEOF 514 } 515 m.Body = append(m.Body[:0], dAtA[iNdEx:postIndex]...) 516 if m.Body == nil { 517 m.Body = []byte{} 518 } 519 iNdEx = postIndex 520 default: 521 iNdEx = preIndex 522 skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 523 if err != nil { 524 return err 525 } 526 if (skippy < 0) || (iNdEx+skippy) < 0 { 527 return protohelpers.ErrInvalidLength 528 } 529 if (iNdEx + skippy) > l { 530 return io.ErrUnexpectedEOF 531 } 532 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 533 iNdEx += skippy 534 } 535 } 536 537 if iNdEx > l { 538 return io.ErrUnexpectedEOF 539 } 540 return nil 541 } 542 func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { 543 l := len(dAtA) 544 iNdEx := 0 545 for iNdEx < l { 546 preIndex := iNdEx 547 var wire uint64 548 for shift := uint(0); ; shift += 7 { 549 if shift >= 64 { 550 return protohelpers.ErrIntOverflow 551 } 552 if iNdEx >= l { 553 return io.ErrUnexpectedEOF 554 } 555 b := dAtA[iNdEx] 556 iNdEx++ 557 wire |= uint64(b&0x7F) << shift 558 if b < 0x80 { 559 break 560 } 561 } 562 fieldNum := int32(wire >> 3) 563 wireType := int(wire & 0x7) 564 if wireType == 4 { 565 return fmt.Errorf("proto: HTTPResponse: wiretype end group for non-group") 566 } 567 if fieldNum <= 0 { 568 return fmt.Errorf("proto: HTTPResponse: illegal tag %d (wire type %d)", fieldNum, wire) 569 } 570 switch fieldNum { 571 case 1: 572 if wireType != 0 { 573 return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) 574 } 575 m.Code = 0 576 for shift := uint(0); ; shift += 7 { 577 if shift >= 64 { 578 return protohelpers.ErrIntOverflow 579 } 580 if iNdEx >= l { 581 return io.ErrUnexpectedEOF 582 } 583 b := dAtA[iNdEx] 584 iNdEx++ 585 m.Code |= int32(b&0x7F) << shift 586 if b < 0x80 { 587 break 588 } 589 } 590 case 2: 591 if wireType != 2 { 592 return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) 593 } 594 var msglen int 595 for shift := uint(0); ; shift += 7 { 596 if shift >= 64 { 597 return protohelpers.ErrIntOverflow 598 } 599 if iNdEx >= l { 600 return io.ErrUnexpectedEOF 601 } 602 b := dAtA[iNdEx] 603 iNdEx++ 604 msglen |= int(b&0x7F) << shift 605 if b < 0x80 { 606 break 607 } 608 } 609 if msglen < 0 { 610 return protohelpers.ErrInvalidLength 611 } 612 postIndex := iNdEx + msglen 613 if postIndex < 0 { 614 return protohelpers.ErrInvalidLength 615 } 616 if postIndex > l { 617 return io.ErrUnexpectedEOF 618 } 619 m.Headers = append(m.Headers, &Header{}) 620 if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { 621 return err 622 } 623 iNdEx = postIndex 624 case 3: 625 if wireType != 2 { 626 return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) 627 } 628 var byteLen int 629 for shift := uint(0); ; shift += 7 { 630 if shift >= 64 { 631 return protohelpers.ErrIntOverflow 632 } 633 if iNdEx >= l { 634 return io.ErrUnexpectedEOF 635 } 636 b := dAtA[iNdEx] 637 iNdEx++ 638 byteLen |= int(b&0x7F) << shift 639 if b < 0x80 { 640 break 641 } 642 } 643 if byteLen < 0 { 644 return protohelpers.ErrInvalidLength 645 } 646 postIndex := iNdEx + byteLen 647 if postIndex < 0 { 648 return protohelpers.ErrInvalidLength 649 } 650 if postIndex > l { 651 return io.ErrUnexpectedEOF 652 } 653 m.Body = append(m.Body[:0], dAtA[iNdEx:postIndex]...) 654 if m.Body == nil { 655 m.Body = []byte{} 656 } 657 iNdEx = postIndex 658 default: 659 iNdEx = preIndex 660 skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 661 if err != nil { 662 return err 663 } 664 if (skippy < 0) || (iNdEx+skippy) < 0 { 665 return protohelpers.ErrInvalidLength 666 } 667 if (iNdEx + skippy) > l { 668 return io.ErrUnexpectedEOF 669 } 670 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 671 iNdEx += skippy 672 } 673 } 674 675 if iNdEx > l { 676 return io.ErrUnexpectedEOF 677 } 678 return nil 679 } 680 func (m *Header) UnmarshalVT(dAtA []byte) error { 681 l := len(dAtA) 682 iNdEx := 0 683 for iNdEx < l { 684 preIndex := iNdEx 685 var wire uint64 686 for shift := uint(0); ; shift += 7 { 687 if shift >= 64 { 688 return protohelpers.ErrIntOverflow 689 } 690 if iNdEx >= l { 691 return io.ErrUnexpectedEOF 692 } 693 b := dAtA[iNdEx] 694 iNdEx++ 695 wire |= uint64(b&0x7F) << shift 696 if b < 0x80 { 697 break 698 } 699 } 700 fieldNum := int32(wire >> 3) 701 wireType := int(wire & 0x7) 702 if wireType == 4 { 703 return fmt.Errorf("proto: Header: wiretype end group for non-group") 704 } 705 if fieldNum <= 0 { 706 return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) 707 } 708 switch fieldNum { 709 case 1: 710 if wireType != 2 { 711 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 712 } 713 var stringLen uint64 714 for shift := uint(0); ; shift += 7 { 715 if shift >= 64 { 716 return protohelpers.ErrIntOverflow 717 } 718 if iNdEx >= l { 719 return io.ErrUnexpectedEOF 720 } 721 b := dAtA[iNdEx] 722 iNdEx++ 723 stringLen |= uint64(b&0x7F) << shift 724 if b < 0x80 { 725 break 726 } 727 } 728 intStringLen := int(stringLen) 729 if intStringLen < 0 { 730 return protohelpers.ErrInvalidLength 731 } 732 postIndex := iNdEx + intStringLen 733 if postIndex < 0 { 734 return protohelpers.ErrInvalidLength 735 } 736 if postIndex > l { 737 return io.ErrUnexpectedEOF 738 } 739 m.Key = string(dAtA[iNdEx:postIndex]) 740 iNdEx = postIndex 741 case 2: 742 if wireType != 2 { 743 return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) 744 } 745 var stringLen uint64 746 for shift := uint(0); ; shift += 7 { 747 if shift >= 64 { 748 return protohelpers.ErrIntOverflow 749 } 750 if iNdEx >= l { 751 return io.ErrUnexpectedEOF 752 } 753 b := dAtA[iNdEx] 754 iNdEx++ 755 stringLen |= uint64(b&0x7F) << shift 756 if b < 0x80 { 757 break 758 } 759 } 760 intStringLen := int(stringLen) 761 if intStringLen < 0 { 762 return protohelpers.ErrInvalidLength 763 } 764 postIndex := iNdEx + intStringLen 765 if postIndex < 0 { 766 return protohelpers.ErrInvalidLength 767 } 768 if postIndex > l { 769 return io.ErrUnexpectedEOF 770 } 771 m.Values = append(m.Values, string(dAtA[iNdEx:postIndex])) 772 iNdEx = postIndex 773 default: 774 iNdEx = preIndex 775 skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 776 if err != nil { 777 return err 778 } 779 if (skippy < 0) || (iNdEx+skippy) < 0 { 780 return protohelpers.ErrInvalidLength 781 } 782 if (iNdEx + skippy) > l { 783 return io.ErrUnexpectedEOF 784 } 785 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 786 iNdEx += skippy 787 } 788 } 789 790 if iNdEx > l { 791 return io.ErrUnexpectedEOF 792 } 793 return nil 794 }