github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/geo/geoindex/config.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: geo/geoindex/config.proto 3 4 package geoindex 5 6 import proto "github.com/gogo/protobuf/proto" 7 import fmt "fmt" 8 import math "math" 9 10 import encoding_binary "encoding/binary" 11 12 import io "io" 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 24 25 // Config is the information used to tune one instance of a geospatial index. 26 // Each SQL index will have its own config. 27 // 28 // At the moment, only one major indexing strategy is implemented (S2 cells). 29 type Config struct { 30 S2Geography *S2GeographyConfig `protobuf:"bytes,1,opt,name=s2_geography,json=s2Geography,proto3" json:"s2_geography,omitempty"` 31 S2Geometry *S2GeometryConfig `protobuf:"bytes,2,opt,name=s2_geometry,json=s2Geometry,proto3" json:"s2_geometry,omitempty"` 32 } 33 34 func (m *Config) Reset() { *m = Config{} } 35 func (m *Config) String() string { return proto.CompactTextString(m) } 36 func (*Config) ProtoMessage() {} 37 func (*Config) Descriptor() ([]byte, []int) { 38 return fileDescriptor_config_4fdfa32e25381f1e, []int{0} 39 } 40 func (m *Config) XXX_Unmarshal(b []byte) error { 41 return m.Unmarshal(b) 42 } 43 func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 44 b = b[:cap(b)] 45 n, err := m.MarshalTo(b) 46 if err != nil { 47 return nil, err 48 } 49 return b[:n], nil 50 } 51 func (dst *Config) XXX_Merge(src proto.Message) { 52 xxx_messageInfo_Config.Merge(dst, src) 53 } 54 func (m *Config) XXX_Size() int { 55 return m.Size() 56 } 57 func (m *Config) XXX_DiscardUnknown() { 58 xxx_messageInfo_Config.DiscardUnknown(m) 59 } 60 61 var xxx_messageInfo_Config proto.InternalMessageInfo 62 63 // S2Config is the required information to tune one instance of an S2 cell 64 // backed geospatial index. For advanced users only -- the defaults should be 65 // good enough. 66 // 67 // TODO(sumeer): Based on experiments, reduce the knobs below by making the 68 // covering self-tuning. 69 type S2Config struct { 70 // MinLevel is the minimum cell level stored in the index. If left unset, it 71 // defaults to 0. 72 MinLevel int32 `protobuf:"varint,1,opt,name=min_level,json=minLevel,proto3" json:"min_level,omitempty"` 73 // MaxLevel is the maximum cell level stored in the index. If left unset, it 74 // defaults to 30. 75 MaxLevel int32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"` 76 // `MaxLevel-MinLevel` must be an exact multiple of LevelMod. If left unset, 77 // it defaults to 1. 78 LevelMod int32 `protobuf:"varint,3,opt,name=level_mod,json=levelMod,proto3" json:"level_mod,omitempty"` 79 // MaxCells is a soft hint for the maximum number of entries used to store a 80 // single geospatial object. If left unset, it defaults to 4. 81 MaxCells int32 `protobuf:"varint,4,opt,name=max_cells,json=maxCells,proto3" json:"max_cells,omitempty"` 82 } 83 84 func (m *S2Config) Reset() { *m = S2Config{} } 85 func (m *S2Config) String() string { return proto.CompactTextString(m) } 86 func (*S2Config) ProtoMessage() {} 87 func (*S2Config) Descriptor() ([]byte, []int) { 88 return fileDescriptor_config_4fdfa32e25381f1e, []int{1} 89 } 90 func (m *S2Config) XXX_Unmarshal(b []byte) error { 91 return m.Unmarshal(b) 92 } 93 func (m *S2Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 94 b = b[:cap(b)] 95 n, err := m.MarshalTo(b) 96 if err != nil { 97 return nil, err 98 } 99 return b[:n], nil 100 } 101 func (dst *S2Config) XXX_Merge(src proto.Message) { 102 xxx_messageInfo_S2Config.Merge(dst, src) 103 } 104 func (m *S2Config) XXX_Size() int { 105 return m.Size() 106 } 107 func (m *S2Config) XXX_DiscardUnknown() { 108 xxx_messageInfo_S2Config.DiscardUnknown(m) 109 } 110 111 var xxx_messageInfo_S2Config proto.InternalMessageInfo 112 113 type S2GeographyConfig struct { 114 S2Config *S2Config `protobuf:"bytes,1,opt,name=s2_config,json=s2Config,proto3" json:"s2_config,omitempty"` 115 } 116 117 func (m *S2GeographyConfig) Reset() { *m = S2GeographyConfig{} } 118 func (m *S2GeographyConfig) String() string { return proto.CompactTextString(m) } 119 func (*S2GeographyConfig) ProtoMessage() {} 120 func (*S2GeographyConfig) Descriptor() ([]byte, []int) { 121 return fileDescriptor_config_4fdfa32e25381f1e, []int{2} 122 } 123 func (m *S2GeographyConfig) XXX_Unmarshal(b []byte) error { 124 return m.Unmarshal(b) 125 } 126 func (m *S2GeographyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 127 b = b[:cap(b)] 128 n, err := m.MarshalTo(b) 129 if err != nil { 130 return nil, err 131 } 132 return b[:n], nil 133 } 134 func (dst *S2GeographyConfig) XXX_Merge(src proto.Message) { 135 xxx_messageInfo_S2GeographyConfig.Merge(dst, src) 136 } 137 func (m *S2GeographyConfig) XXX_Size() int { 138 return m.Size() 139 } 140 func (m *S2GeographyConfig) XXX_DiscardUnknown() { 141 xxx_messageInfo_S2GeographyConfig.DiscardUnknown(m) 142 } 143 144 var xxx_messageInfo_S2GeographyConfig proto.InternalMessageInfo 145 146 type S2GeometryConfig struct { 147 // The rectangle bounds of the plane that will be efficiently indexed. Shapes 148 // should rarely exceed these bounds. 149 MinX float64 `protobuf:"fixed64,1,opt,name=min_x,json=minX,proto3" json:"min_x,omitempty"` 150 MaxX float64 `protobuf:"fixed64,2,opt,name=max_x,json=maxX,proto3" json:"max_x,omitempty"` 151 MinY float64 `protobuf:"fixed64,3,opt,name=min_y,json=minY,proto3" json:"min_y,omitempty"` 152 MaxY float64 `protobuf:"fixed64,4,opt,name=max_y,json=maxY,proto3" json:"max_y,omitempty"` 153 S2Config *S2Config `protobuf:"bytes,5,opt,name=s2_config,json=s2Config,proto3" json:"s2_config,omitempty"` 154 } 155 156 func (m *S2GeometryConfig) Reset() { *m = S2GeometryConfig{} } 157 func (m *S2GeometryConfig) String() string { return proto.CompactTextString(m) } 158 func (*S2GeometryConfig) ProtoMessage() {} 159 func (*S2GeometryConfig) Descriptor() ([]byte, []int) { 160 return fileDescriptor_config_4fdfa32e25381f1e, []int{3} 161 } 162 func (m *S2GeometryConfig) XXX_Unmarshal(b []byte) error { 163 return m.Unmarshal(b) 164 } 165 func (m *S2GeometryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 166 b = b[:cap(b)] 167 n, err := m.MarshalTo(b) 168 if err != nil { 169 return nil, err 170 } 171 return b[:n], nil 172 } 173 func (dst *S2GeometryConfig) XXX_Merge(src proto.Message) { 174 xxx_messageInfo_S2GeometryConfig.Merge(dst, src) 175 } 176 func (m *S2GeometryConfig) XXX_Size() int { 177 return m.Size() 178 } 179 func (m *S2GeometryConfig) XXX_DiscardUnknown() { 180 xxx_messageInfo_S2GeometryConfig.DiscardUnknown(m) 181 } 182 183 var xxx_messageInfo_S2GeometryConfig proto.InternalMessageInfo 184 185 func init() { 186 proto.RegisterType((*Config)(nil), "cockroach.geo.geoindex.Config") 187 proto.RegisterType((*S2Config)(nil), "cockroach.geo.geoindex.S2Config") 188 proto.RegisterType((*S2GeographyConfig)(nil), "cockroach.geo.geoindex.S2GeographyConfig") 189 proto.RegisterType((*S2GeometryConfig)(nil), "cockroach.geo.geoindex.S2GeometryConfig") 190 } 191 func (this *Config) Equal(that interface{}) bool { 192 if that == nil { 193 return this == nil 194 } 195 196 that1, ok := that.(*Config) 197 if !ok { 198 that2, ok := that.(Config) 199 if ok { 200 that1 = &that2 201 } else { 202 return false 203 } 204 } 205 if that1 == nil { 206 return this == nil 207 } else if this == nil { 208 return false 209 } 210 if !this.S2Geography.Equal(that1.S2Geography) { 211 return false 212 } 213 if !this.S2Geometry.Equal(that1.S2Geometry) { 214 return false 215 } 216 return true 217 } 218 func (this *S2Config) Equal(that interface{}) bool { 219 if that == nil { 220 return this == nil 221 } 222 223 that1, ok := that.(*S2Config) 224 if !ok { 225 that2, ok := that.(S2Config) 226 if ok { 227 that1 = &that2 228 } else { 229 return false 230 } 231 } 232 if that1 == nil { 233 return this == nil 234 } else if this == nil { 235 return false 236 } 237 if this.MinLevel != that1.MinLevel { 238 return false 239 } 240 if this.MaxLevel != that1.MaxLevel { 241 return false 242 } 243 if this.LevelMod != that1.LevelMod { 244 return false 245 } 246 if this.MaxCells != that1.MaxCells { 247 return false 248 } 249 return true 250 } 251 func (this *S2GeographyConfig) Equal(that interface{}) bool { 252 if that == nil { 253 return this == nil 254 } 255 256 that1, ok := that.(*S2GeographyConfig) 257 if !ok { 258 that2, ok := that.(S2GeographyConfig) 259 if ok { 260 that1 = &that2 261 } else { 262 return false 263 } 264 } 265 if that1 == nil { 266 return this == nil 267 } else if this == nil { 268 return false 269 } 270 if !this.S2Config.Equal(that1.S2Config) { 271 return false 272 } 273 return true 274 } 275 func (this *S2GeometryConfig) Equal(that interface{}) bool { 276 if that == nil { 277 return this == nil 278 } 279 280 that1, ok := that.(*S2GeometryConfig) 281 if !ok { 282 that2, ok := that.(S2GeometryConfig) 283 if ok { 284 that1 = &that2 285 } else { 286 return false 287 } 288 } 289 if that1 == nil { 290 return this == nil 291 } else if this == nil { 292 return false 293 } 294 if this.MinX != that1.MinX { 295 return false 296 } 297 if this.MaxX != that1.MaxX { 298 return false 299 } 300 if this.MinY != that1.MinY { 301 return false 302 } 303 if this.MaxY != that1.MaxY { 304 return false 305 } 306 if !this.S2Config.Equal(that1.S2Config) { 307 return false 308 } 309 return true 310 } 311 func (m *Config) Marshal() (dAtA []byte, err error) { 312 size := m.Size() 313 dAtA = make([]byte, size) 314 n, err := m.MarshalTo(dAtA) 315 if err != nil { 316 return nil, err 317 } 318 return dAtA[:n], nil 319 } 320 321 func (m *Config) MarshalTo(dAtA []byte) (int, error) { 322 var i int 323 _ = i 324 var l int 325 _ = l 326 if m.S2Geography != nil { 327 dAtA[i] = 0xa 328 i++ 329 i = encodeVarintConfig(dAtA, i, uint64(m.S2Geography.Size())) 330 n1, err := m.S2Geography.MarshalTo(dAtA[i:]) 331 if err != nil { 332 return 0, err 333 } 334 i += n1 335 } 336 if m.S2Geometry != nil { 337 dAtA[i] = 0x12 338 i++ 339 i = encodeVarintConfig(dAtA, i, uint64(m.S2Geometry.Size())) 340 n2, err := m.S2Geometry.MarshalTo(dAtA[i:]) 341 if err != nil { 342 return 0, err 343 } 344 i += n2 345 } 346 return i, nil 347 } 348 349 func (m *S2Config) Marshal() (dAtA []byte, err error) { 350 size := m.Size() 351 dAtA = make([]byte, size) 352 n, err := m.MarshalTo(dAtA) 353 if err != nil { 354 return nil, err 355 } 356 return dAtA[:n], nil 357 } 358 359 func (m *S2Config) MarshalTo(dAtA []byte) (int, error) { 360 var i int 361 _ = i 362 var l int 363 _ = l 364 if m.MinLevel != 0 { 365 dAtA[i] = 0x8 366 i++ 367 i = encodeVarintConfig(dAtA, i, uint64(m.MinLevel)) 368 } 369 if m.MaxLevel != 0 { 370 dAtA[i] = 0x10 371 i++ 372 i = encodeVarintConfig(dAtA, i, uint64(m.MaxLevel)) 373 } 374 if m.LevelMod != 0 { 375 dAtA[i] = 0x18 376 i++ 377 i = encodeVarintConfig(dAtA, i, uint64(m.LevelMod)) 378 } 379 if m.MaxCells != 0 { 380 dAtA[i] = 0x20 381 i++ 382 i = encodeVarintConfig(dAtA, i, uint64(m.MaxCells)) 383 } 384 return i, nil 385 } 386 387 func (m *S2GeographyConfig) Marshal() (dAtA []byte, err error) { 388 size := m.Size() 389 dAtA = make([]byte, size) 390 n, err := m.MarshalTo(dAtA) 391 if err != nil { 392 return nil, err 393 } 394 return dAtA[:n], nil 395 } 396 397 func (m *S2GeographyConfig) MarshalTo(dAtA []byte) (int, error) { 398 var i int 399 _ = i 400 var l int 401 _ = l 402 if m.S2Config != nil { 403 dAtA[i] = 0xa 404 i++ 405 i = encodeVarintConfig(dAtA, i, uint64(m.S2Config.Size())) 406 n3, err := m.S2Config.MarshalTo(dAtA[i:]) 407 if err != nil { 408 return 0, err 409 } 410 i += n3 411 } 412 return i, nil 413 } 414 415 func (m *S2GeometryConfig) Marshal() (dAtA []byte, err error) { 416 size := m.Size() 417 dAtA = make([]byte, size) 418 n, err := m.MarshalTo(dAtA) 419 if err != nil { 420 return nil, err 421 } 422 return dAtA[:n], nil 423 } 424 425 func (m *S2GeometryConfig) MarshalTo(dAtA []byte) (int, error) { 426 var i int 427 _ = i 428 var l int 429 _ = l 430 if m.MinX != 0 { 431 dAtA[i] = 0x9 432 i++ 433 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MinX)))) 434 i += 8 435 } 436 if m.MaxX != 0 { 437 dAtA[i] = 0x11 438 i++ 439 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxX)))) 440 i += 8 441 } 442 if m.MinY != 0 { 443 dAtA[i] = 0x19 444 i++ 445 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MinY)))) 446 i += 8 447 } 448 if m.MaxY != 0 { 449 dAtA[i] = 0x21 450 i++ 451 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.MaxY)))) 452 i += 8 453 } 454 if m.S2Config != nil { 455 dAtA[i] = 0x2a 456 i++ 457 i = encodeVarintConfig(dAtA, i, uint64(m.S2Config.Size())) 458 n4, err := m.S2Config.MarshalTo(dAtA[i:]) 459 if err != nil { 460 return 0, err 461 } 462 i += n4 463 } 464 return i, nil 465 } 466 467 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { 468 for v >= 1<<7 { 469 dAtA[offset] = uint8(v&0x7f | 0x80) 470 v >>= 7 471 offset++ 472 } 473 dAtA[offset] = uint8(v) 474 return offset + 1 475 } 476 func (m *Config) Size() (n int) { 477 if m == nil { 478 return 0 479 } 480 var l int 481 _ = l 482 if m.S2Geography != nil { 483 l = m.S2Geography.Size() 484 n += 1 + l + sovConfig(uint64(l)) 485 } 486 if m.S2Geometry != nil { 487 l = m.S2Geometry.Size() 488 n += 1 + l + sovConfig(uint64(l)) 489 } 490 return n 491 } 492 493 func (m *S2Config) Size() (n int) { 494 if m == nil { 495 return 0 496 } 497 var l int 498 _ = l 499 if m.MinLevel != 0 { 500 n += 1 + sovConfig(uint64(m.MinLevel)) 501 } 502 if m.MaxLevel != 0 { 503 n += 1 + sovConfig(uint64(m.MaxLevel)) 504 } 505 if m.LevelMod != 0 { 506 n += 1 + sovConfig(uint64(m.LevelMod)) 507 } 508 if m.MaxCells != 0 { 509 n += 1 + sovConfig(uint64(m.MaxCells)) 510 } 511 return n 512 } 513 514 func (m *S2GeographyConfig) Size() (n int) { 515 if m == nil { 516 return 0 517 } 518 var l int 519 _ = l 520 if m.S2Config != nil { 521 l = m.S2Config.Size() 522 n += 1 + l + sovConfig(uint64(l)) 523 } 524 return n 525 } 526 527 func (m *S2GeometryConfig) Size() (n int) { 528 if m == nil { 529 return 0 530 } 531 var l int 532 _ = l 533 if m.MinX != 0 { 534 n += 9 535 } 536 if m.MaxX != 0 { 537 n += 9 538 } 539 if m.MinY != 0 { 540 n += 9 541 } 542 if m.MaxY != 0 { 543 n += 9 544 } 545 if m.S2Config != nil { 546 l = m.S2Config.Size() 547 n += 1 + l + sovConfig(uint64(l)) 548 } 549 return n 550 } 551 552 func sovConfig(x uint64) (n int) { 553 for { 554 n++ 555 x >>= 7 556 if x == 0 { 557 break 558 } 559 } 560 return n 561 } 562 func sozConfig(x uint64) (n int) { 563 return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 564 } 565 func (this *Config) GetValue() interface{} { 566 if this.S2Geography != nil { 567 return this.S2Geography 568 } 569 if this.S2Geometry != nil { 570 return this.S2Geometry 571 } 572 return nil 573 } 574 575 func (this *Config) SetValue(value interface{}) bool { 576 switch vt := value.(type) { 577 case *S2GeographyConfig: 578 this.S2Geography = vt 579 case *S2GeometryConfig: 580 this.S2Geometry = vt 581 default: 582 return false 583 } 584 return true 585 } 586 func (m *Config) Unmarshal(dAtA []byte) error { 587 l := len(dAtA) 588 iNdEx := 0 589 for iNdEx < l { 590 preIndex := iNdEx 591 var wire uint64 592 for shift := uint(0); ; shift += 7 { 593 if shift >= 64 { 594 return ErrIntOverflowConfig 595 } 596 if iNdEx >= l { 597 return io.ErrUnexpectedEOF 598 } 599 b := dAtA[iNdEx] 600 iNdEx++ 601 wire |= (uint64(b) & 0x7F) << shift 602 if b < 0x80 { 603 break 604 } 605 } 606 fieldNum := int32(wire >> 3) 607 wireType := int(wire & 0x7) 608 if wireType == 4 { 609 return fmt.Errorf("proto: Config: wiretype end group for non-group") 610 } 611 if fieldNum <= 0 { 612 return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire) 613 } 614 switch fieldNum { 615 case 1: 616 if wireType != 2 { 617 return fmt.Errorf("proto: wrong wireType = %d for field S2Geography", wireType) 618 } 619 var msglen int 620 for shift := uint(0); ; shift += 7 { 621 if shift >= 64 { 622 return ErrIntOverflowConfig 623 } 624 if iNdEx >= l { 625 return io.ErrUnexpectedEOF 626 } 627 b := dAtA[iNdEx] 628 iNdEx++ 629 msglen |= (int(b) & 0x7F) << shift 630 if b < 0x80 { 631 break 632 } 633 } 634 if msglen < 0 { 635 return ErrInvalidLengthConfig 636 } 637 postIndex := iNdEx + msglen 638 if postIndex > l { 639 return io.ErrUnexpectedEOF 640 } 641 if m.S2Geography == nil { 642 m.S2Geography = &S2GeographyConfig{} 643 } 644 if err := m.S2Geography.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 645 return err 646 } 647 iNdEx = postIndex 648 case 2: 649 if wireType != 2 { 650 return fmt.Errorf("proto: wrong wireType = %d for field S2Geometry", wireType) 651 } 652 var msglen int 653 for shift := uint(0); ; shift += 7 { 654 if shift >= 64 { 655 return ErrIntOverflowConfig 656 } 657 if iNdEx >= l { 658 return io.ErrUnexpectedEOF 659 } 660 b := dAtA[iNdEx] 661 iNdEx++ 662 msglen |= (int(b) & 0x7F) << shift 663 if b < 0x80 { 664 break 665 } 666 } 667 if msglen < 0 { 668 return ErrInvalidLengthConfig 669 } 670 postIndex := iNdEx + msglen 671 if postIndex > l { 672 return io.ErrUnexpectedEOF 673 } 674 if m.S2Geometry == nil { 675 m.S2Geometry = &S2GeometryConfig{} 676 } 677 if err := m.S2Geometry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 678 return err 679 } 680 iNdEx = postIndex 681 default: 682 iNdEx = preIndex 683 skippy, err := skipConfig(dAtA[iNdEx:]) 684 if err != nil { 685 return err 686 } 687 if skippy < 0 { 688 return ErrInvalidLengthConfig 689 } 690 if (iNdEx + skippy) > l { 691 return io.ErrUnexpectedEOF 692 } 693 iNdEx += skippy 694 } 695 } 696 697 if iNdEx > l { 698 return io.ErrUnexpectedEOF 699 } 700 return nil 701 } 702 func (m *S2Config) Unmarshal(dAtA []byte) error { 703 l := len(dAtA) 704 iNdEx := 0 705 for iNdEx < l { 706 preIndex := iNdEx 707 var wire uint64 708 for shift := uint(0); ; shift += 7 { 709 if shift >= 64 { 710 return ErrIntOverflowConfig 711 } 712 if iNdEx >= l { 713 return io.ErrUnexpectedEOF 714 } 715 b := dAtA[iNdEx] 716 iNdEx++ 717 wire |= (uint64(b) & 0x7F) << shift 718 if b < 0x80 { 719 break 720 } 721 } 722 fieldNum := int32(wire >> 3) 723 wireType := int(wire & 0x7) 724 if wireType == 4 { 725 return fmt.Errorf("proto: S2Config: wiretype end group for non-group") 726 } 727 if fieldNum <= 0 { 728 return fmt.Errorf("proto: S2Config: illegal tag %d (wire type %d)", fieldNum, wire) 729 } 730 switch fieldNum { 731 case 1: 732 if wireType != 0 { 733 return fmt.Errorf("proto: wrong wireType = %d for field MinLevel", wireType) 734 } 735 m.MinLevel = 0 736 for shift := uint(0); ; shift += 7 { 737 if shift >= 64 { 738 return ErrIntOverflowConfig 739 } 740 if iNdEx >= l { 741 return io.ErrUnexpectedEOF 742 } 743 b := dAtA[iNdEx] 744 iNdEx++ 745 m.MinLevel |= (int32(b) & 0x7F) << shift 746 if b < 0x80 { 747 break 748 } 749 } 750 case 2: 751 if wireType != 0 { 752 return fmt.Errorf("proto: wrong wireType = %d for field MaxLevel", wireType) 753 } 754 m.MaxLevel = 0 755 for shift := uint(0); ; shift += 7 { 756 if shift >= 64 { 757 return ErrIntOverflowConfig 758 } 759 if iNdEx >= l { 760 return io.ErrUnexpectedEOF 761 } 762 b := dAtA[iNdEx] 763 iNdEx++ 764 m.MaxLevel |= (int32(b) & 0x7F) << shift 765 if b < 0x80 { 766 break 767 } 768 } 769 case 3: 770 if wireType != 0 { 771 return fmt.Errorf("proto: wrong wireType = %d for field LevelMod", wireType) 772 } 773 m.LevelMod = 0 774 for shift := uint(0); ; shift += 7 { 775 if shift >= 64 { 776 return ErrIntOverflowConfig 777 } 778 if iNdEx >= l { 779 return io.ErrUnexpectedEOF 780 } 781 b := dAtA[iNdEx] 782 iNdEx++ 783 m.LevelMod |= (int32(b) & 0x7F) << shift 784 if b < 0x80 { 785 break 786 } 787 } 788 case 4: 789 if wireType != 0 { 790 return fmt.Errorf("proto: wrong wireType = %d for field MaxCells", wireType) 791 } 792 m.MaxCells = 0 793 for shift := uint(0); ; shift += 7 { 794 if shift >= 64 { 795 return ErrIntOverflowConfig 796 } 797 if iNdEx >= l { 798 return io.ErrUnexpectedEOF 799 } 800 b := dAtA[iNdEx] 801 iNdEx++ 802 m.MaxCells |= (int32(b) & 0x7F) << shift 803 if b < 0x80 { 804 break 805 } 806 } 807 default: 808 iNdEx = preIndex 809 skippy, err := skipConfig(dAtA[iNdEx:]) 810 if err != nil { 811 return err 812 } 813 if skippy < 0 { 814 return ErrInvalidLengthConfig 815 } 816 if (iNdEx + skippy) > l { 817 return io.ErrUnexpectedEOF 818 } 819 iNdEx += skippy 820 } 821 } 822 823 if iNdEx > l { 824 return io.ErrUnexpectedEOF 825 } 826 return nil 827 } 828 func (m *S2GeographyConfig) Unmarshal(dAtA []byte) error { 829 l := len(dAtA) 830 iNdEx := 0 831 for iNdEx < l { 832 preIndex := iNdEx 833 var wire uint64 834 for shift := uint(0); ; shift += 7 { 835 if shift >= 64 { 836 return ErrIntOverflowConfig 837 } 838 if iNdEx >= l { 839 return io.ErrUnexpectedEOF 840 } 841 b := dAtA[iNdEx] 842 iNdEx++ 843 wire |= (uint64(b) & 0x7F) << shift 844 if b < 0x80 { 845 break 846 } 847 } 848 fieldNum := int32(wire >> 3) 849 wireType := int(wire & 0x7) 850 if wireType == 4 { 851 return fmt.Errorf("proto: S2GeographyConfig: wiretype end group for non-group") 852 } 853 if fieldNum <= 0 { 854 return fmt.Errorf("proto: S2GeographyConfig: illegal tag %d (wire type %d)", fieldNum, wire) 855 } 856 switch fieldNum { 857 case 1: 858 if wireType != 2 { 859 return fmt.Errorf("proto: wrong wireType = %d for field S2Config", wireType) 860 } 861 var msglen int 862 for shift := uint(0); ; shift += 7 { 863 if shift >= 64 { 864 return ErrIntOverflowConfig 865 } 866 if iNdEx >= l { 867 return io.ErrUnexpectedEOF 868 } 869 b := dAtA[iNdEx] 870 iNdEx++ 871 msglen |= (int(b) & 0x7F) << shift 872 if b < 0x80 { 873 break 874 } 875 } 876 if msglen < 0 { 877 return ErrInvalidLengthConfig 878 } 879 postIndex := iNdEx + msglen 880 if postIndex > l { 881 return io.ErrUnexpectedEOF 882 } 883 if m.S2Config == nil { 884 m.S2Config = &S2Config{} 885 } 886 if err := m.S2Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 887 return err 888 } 889 iNdEx = postIndex 890 default: 891 iNdEx = preIndex 892 skippy, err := skipConfig(dAtA[iNdEx:]) 893 if err != nil { 894 return err 895 } 896 if skippy < 0 { 897 return ErrInvalidLengthConfig 898 } 899 if (iNdEx + skippy) > l { 900 return io.ErrUnexpectedEOF 901 } 902 iNdEx += skippy 903 } 904 } 905 906 if iNdEx > l { 907 return io.ErrUnexpectedEOF 908 } 909 return nil 910 } 911 func (m *S2GeometryConfig) Unmarshal(dAtA []byte) error { 912 l := len(dAtA) 913 iNdEx := 0 914 for iNdEx < l { 915 preIndex := iNdEx 916 var wire uint64 917 for shift := uint(0); ; shift += 7 { 918 if shift >= 64 { 919 return ErrIntOverflowConfig 920 } 921 if iNdEx >= l { 922 return io.ErrUnexpectedEOF 923 } 924 b := dAtA[iNdEx] 925 iNdEx++ 926 wire |= (uint64(b) & 0x7F) << shift 927 if b < 0x80 { 928 break 929 } 930 } 931 fieldNum := int32(wire >> 3) 932 wireType := int(wire & 0x7) 933 if wireType == 4 { 934 return fmt.Errorf("proto: S2GeometryConfig: wiretype end group for non-group") 935 } 936 if fieldNum <= 0 { 937 return fmt.Errorf("proto: S2GeometryConfig: illegal tag %d (wire type %d)", fieldNum, wire) 938 } 939 switch fieldNum { 940 case 1: 941 if wireType != 1 { 942 return fmt.Errorf("proto: wrong wireType = %d for field MinX", wireType) 943 } 944 var v uint64 945 if (iNdEx + 8) > l { 946 return io.ErrUnexpectedEOF 947 } 948 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 949 iNdEx += 8 950 m.MinX = float64(math.Float64frombits(v)) 951 case 2: 952 if wireType != 1 { 953 return fmt.Errorf("proto: wrong wireType = %d for field MaxX", wireType) 954 } 955 var v uint64 956 if (iNdEx + 8) > l { 957 return io.ErrUnexpectedEOF 958 } 959 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 960 iNdEx += 8 961 m.MaxX = float64(math.Float64frombits(v)) 962 case 3: 963 if wireType != 1 { 964 return fmt.Errorf("proto: wrong wireType = %d for field MinY", wireType) 965 } 966 var v uint64 967 if (iNdEx + 8) > l { 968 return io.ErrUnexpectedEOF 969 } 970 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 971 iNdEx += 8 972 m.MinY = float64(math.Float64frombits(v)) 973 case 4: 974 if wireType != 1 { 975 return fmt.Errorf("proto: wrong wireType = %d for field MaxY", wireType) 976 } 977 var v uint64 978 if (iNdEx + 8) > l { 979 return io.ErrUnexpectedEOF 980 } 981 v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) 982 iNdEx += 8 983 m.MaxY = float64(math.Float64frombits(v)) 984 case 5: 985 if wireType != 2 { 986 return fmt.Errorf("proto: wrong wireType = %d for field S2Config", wireType) 987 } 988 var msglen int 989 for shift := uint(0); ; shift += 7 { 990 if shift >= 64 { 991 return ErrIntOverflowConfig 992 } 993 if iNdEx >= l { 994 return io.ErrUnexpectedEOF 995 } 996 b := dAtA[iNdEx] 997 iNdEx++ 998 msglen |= (int(b) & 0x7F) << shift 999 if b < 0x80 { 1000 break 1001 } 1002 } 1003 if msglen < 0 { 1004 return ErrInvalidLengthConfig 1005 } 1006 postIndex := iNdEx + msglen 1007 if postIndex > l { 1008 return io.ErrUnexpectedEOF 1009 } 1010 if m.S2Config == nil { 1011 m.S2Config = &S2Config{} 1012 } 1013 if err := m.S2Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1014 return err 1015 } 1016 iNdEx = postIndex 1017 default: 1018 iNdEx = preIndex 1019 skippy, err := skipConfig(dAtA[iNdEx:]) 1020 if err != nil { 1021 return err 1022 } 1023 if skippy < 0 { 1024 return ErrInvalidLengthConfig 1025 } 1026 if (iNdEx + skippy) > l { 1027 return io.ErrUnexpectedEOF 1028 } 1029 iNdEx += skippy 1030 } 1031 } 1032 1033 if iNdEx > l { 1034 return io.ErrUnexpectedEOF 1035 } 1036 return nil 1037 } 1038 func skipConfig(dAtA []byte) (n int, err error) { 1039 l := len(dAtA) 1040 iNdEx := 0 1041 for iNdEx < l { 1042 var wire uint64 1043 for shift := uint(0); ; shift += 7 { 1044 if shift >= 64 { 1045 return 0, ErrIntOverflowConfig 1046 } 1047 if iNdEx >= l { 1048 return 0, io.ErrUnexpectedEOF 1049 } 1050 b := dAtA[iNdEx] 1051 iNdEx++ 1052 wire |= (uint64(b) & 0x7F) << shift 1053 if b < 0x80 { 1054 break 1055 } 1056 } 1057 wireType := int(wire & 0x7) 1058 switch wireType { 1059 case 0: 1060 for shift := uint(0); ; shift += 7 { 1061 if shift >= 64 { 1062 return 0, ErrIntOverflowConfig 1063 } 1064 if iNdEx >= l { 1065 return 0, io.ErrUnexpectedEOF 1066 } 1067 iNdEx++ 1068 if dAtA[iNdEx-1] < 0x80 { 1069 break 1070 } 1071 } 1072 return iNdEx, nil 1073 case 1: 1074 iNdEx += 8 1075 return iNdEx, nil 1076 case 2: 1077 var length int 1078 for shift := uint(0); ; shift += 7 { 1079 if shift >= 64 { 1080 return 0, ErrIntOverflowConfig 1081 } 1082 if iNdEx >= l { 1083 return 0, io.ErrUnexpectedEOF 1084 } 1085 b := dAtA[iNdEx] 1086 iNdEx++ 1087 length |= (int(b) & 0x7F) << shift 1088 if b < 0x80 { 1089 break 1090 } 1091 } 1092 iNdEx += length 1093 if length < 0 { 1094 return 0, ErrInvalidLengthConfig 1095 } 1096 return iNdEx, nil 1097 case 3: 1098 for { 1099 var innerWire uint64 1100 var start int = iNdEx 1101 for shift := uint(0); ; shift += 7 { 1102 if shift >= 64 { 1103 return 0, ErrIntOverflowConfig 1104 } 1105 if iNdEx >= l { 1106 return 0, io.ErrUnexpectedEOF 1107 } 1108 b := dAtA[iNdEx] 1109 iNdEx++ 1110 innerWire |= (uint64(b) & 0x7F) << shift 1111 if b < 0x80 { 1112 break 1113 } 1114 } 1115 innerWireType := int(innerWire & 0x7) 1116 if innerWireType == 4 { 1117 break 1118 } 1119 next, err := skipConfig(dAtA[start:]) 1120 if err != nil { 1121 return 0, err 1122 } 1123 iNdEx = start + next 1124 } 1125 return iNdEx, nil 1126 case 4: 1127 return iNdEx, nil 1128 case 5: 1129 iNdEx += 4 1130 return iNdEx, nil 1131 default: 1132 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1133 } 1134 } 1135 panic("unreachable") 1136 } 1137 1138 var ( 1139 ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") 1140 ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") 1141 ) 1142 1143 func init() { proto.RegisterFile("geo/geoindex/config.proto", fileDescriptor_config_4fdfa32e25381f1e) } 1144 1145 var fileDescriptor_config_4fdfa32e25381f1e = []byte{ 1146 // 376 bytes of a gzipped FileDescriptorProto 1147 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbf, 0x6e, 0xea, 0x30, 1148 0x18, 0xc5, 0x63, 0x2e, 0xa0, 0x60, 0xee, 0x70, 0x6f, 0xee, 0x55, 0x95, 0xb6, 0x92, 0x41, 0x4c, 1149 0xb4, 0x43, 0x90, 0xd2, 0x0d, 0xa9, 0x4b, 0x19, 0xaa, 0x4a, 0x74, 0x81, 0x05, 0xba, 0x44, 0x69, 1150 0x70, 0x4d, 0xd4, 0x24, 0x46, 0x09, 0xaa, 0x9c, 0xbd, 0x0f, 0xd0, 0x47, 0x60, 0xe7, 0x45, 0x18, 1151 0x19, 0x19, 0xdb, 0xb0, 0xf4, 0x31, 0xaa, 0x7c, 0x76, 0xa8, 0xfa, 0x77, 0xe8, 0x66, 0x7f, 0xe7, 1152 0x7c, 0x3f, 0x9d, 0xe3, 0x04, 0xef, 0x33, 0xca, 0x3b, 0x8c, 0x72, 0x3f, 0x9a, 0x50, 0xd1, 0xf1, 1153 0x78, 0x74, 0xe3, 0x33, 0x6b, 0x16, 0xf3, 0x39, 0x37, 0xf6, 0x3c, 0xee, 0xdd, 0xc6, 0xdc, 0xf5, 1154 0xa6, 0x16, 0xa3, 0xdc, 0x2a, 0x4c, 0x07, 0xff, 0x19, 0x67, 0x1c, 0x2c, 0x9d, 0xfc, 0x24, 0xdd, 1155 0xad, 0x25, 0xc2, 0xd5, 0x1e, 0xac, 0x1b, 0x7d, 0xfc, 0x3b, 0xb1, 0x1d, 0x46, 0x39, 0x8b, 0xdd, 1156 0xd9, 0x34, 0x35, 0x51, 0x13, 0xb5, 0xeb, 0xf6, 0x91, 0xf5, 0x39, 0xcf, 0x1a, 0xda, 0xe7, 0x85, 1157 0x55, 0x02, 0x06, 0xf5, 0xe4, 0x75, 0x64, 0x5c, 0xe0, 0xba, 0xa4, 0x85, 0x74, 0x1e, 0xa7, 0x66, 1158 0x09, 0x60, 0xed, 0x6f, 0x61, 0xe0, 0x54, 0x2c, 0x9c, 0xec, 0x26, 0x5d, 0x7d, 0xb5, 0x68, 0xa0, 1159 0xe7, 0x45, 0x03, 0xb5, 0xee, 0x11, 0xd6, 0x87, 0xb6, 0xca, 0x7b, 0x88, 0x6b, 0xa1, 0x1f, 0x39, 1160 0x01, 0xbd, 0xa3, 0x01, 0x84, 0xad, 0x0c, 0xf4, 0xd0, 0x8f, 0xfa, 0xf9, 0x1d, 0x44, 0x57, 0x28, 1161 0xb1, 0xa4, 0x44, 0x57, 0xec, 0x44, 0x10, 0x9c, 0x90, 0x4f, 0xcc, 0x5f, 0x52, 0x84, 0xc1, 0x25, 1162 0x9f, 0x14, 0x9b, 0x1e, 0x0d, 0x82, 0xc4, 0x2c, 0xef, 0x36, 0x7b, 0xf9, 0xbd, 0x5b, 0x86, 0x18, 1163 0x23, 0xfc, 0xf7, 0x43, 0x7b, 0xe3, 0x14, 0xd7, 0x12, 0xdb, 0x91, 0x9f, 0x42, 0xbd, 0x5d, 0xf3, 1164 0xeb, 0xba, 0xaa, 0xa6, 0x9e, 0xa8, 0x93, 0x22, 0x2f, 0x11, 0xfe, 0xf3, 0xfe, 0x2d, 0x8c, 0x7f, 1165 0xb8, 0x92, 0x17, 0x15, 0x40, 0x45, 0x83, 0x72, 0xe8, 0x47, 0x23, 0x18, 0xba, 0xc2, 0x11, 0x50, 1166 0x2e, 0x1f, 0xba, 0x62, 0x54, 0x38, 0x53, 0x28, 0x25, 0x9d, 0xe3, 0xc2, 0x99, 0x42, 0x19, 0xe9, 1167 0x1c, 0xbf, 0x4d, 0x5b, 0xf9, 0x59, 0xda, 0xb3, 0xe3, 0xd5, 0x13, 0xd1, 0x56, 0x19, 0x41, 0xeb, 1168 0x8c, 0xa0, 0x4d, 0x46, 0xd0, 0x63, 0x46, 0xd0, 0xc3, 0x96, 0x68, 0xeb, 0x2d, 0xd1, 0x36, 0x5b, 1169 0xa2, 0x5d, 0xe9, 0x05, 0xe4, 0xba, 0x0a, 0xff, 0xdb, 0xc9, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 1170 0xb1, 0xfa, 0x92, 0x6c, 0xba, 0x02, 0x00, 0x00, 1171 }