github.com/gogo/protobuf@v1.3.2/test/indeximport-issue72/index/index.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: index.proto 3 4 package index 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 _ "github.com/gogo/protobuf/gogoproto" 10 proto "github.com/gogo/protobuf/proto" 11 io "io" 12 math "math" 13 math_bits "math/bits" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 26 27 type IndexQuery struct { 28 Key *string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"` 29 Value *string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"` 30 XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 XXX_unrecognized []byte `json:"-"` 32 XXX_sizecache int32 `json:"-"` 33 } 34 35 func (m *IndexQuery) Reset() { *m = IndexQuery{} } 36 func (m *IndexQuery) String() string { return proto.CompactTextString(m) } 37 func (*IndexQuery) ProtoMessage() {} 38 func (*IndexQuery) Descriptor() ([]byte, []int) { 39 return fileDescriptor_f750e0f7889345b5, []int{0} 40 } 41 func (m *IndexQuery) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *IndexQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_IndexQuery.Marshal(b, m, deterministic) 47 } else { 48 b = b[:cap(b)] 49 n, err := m.MarshalToSizedBuffer(b) 50 if err != nil { 51 return nil, err 52 } 53 return b[:n], nil 54 } 55 } 56 func (m *IndexQuery) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_IndexQuery.Merge(m, src) 58 } 59 func (m *IndexQuery) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *IndexQuery) XXX_DiscardUnknown() { 63 xxx_messageInfo_IndexQuery.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_IndexQuery proto.InternalMessageInfo 67 68 func (m *IndexQuery) GetKey() string { 69 if m != nil && m.Key != nil { 70 return *m.Key 71 } 72 return "" 73 } 74 75 func (m *IndexQuery) GetValue() string { 76 if m != nil && m.Value != nil { 77 return *m.Value 78 } 79 return "" 80 } 81 82 func init() { 83 proto.RegisterType((*IndexQuery)(nil), "index.IndexQuery") 84 } 85 86 func init() { proto.RegisterFile("index.proto", fileDescriptor_f750e0f7889345b5) } 87 88 var fileDescriptor_f750e0f7889345b5 = []byte{ 89 // 141 bytes of a gzipped FileDescriptorProto 90 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0xcc, 0x4b, 0x49, 91 0xad, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x73, 0xa4, 0x74, 0xd3, 0x33, 0x4b, 92 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, 0xc1, 0xb2, 0x49, 93 0xa5, 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0x74, 0x29, 0x99, 0x70, 0x71, 0x79, 0x82, 0xf4, 94 0x05, 0x96, 0xa6, 0x16, 0x55, 0x0a, 0x09, 0x70, 0x31, 0x7b, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 95 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 96 0x60, 0x31, 0x08, 0xc7, 0x49, 0xe2, 0xc7, 0x43, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x77, 0x3c, 97 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x01, 98 0x01, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x3d, 0x8f, 0x44, 0x93, 0x00, 0x00, 0x00, 99 } 100 101 func (this *IndexQuery) Equal(that interface{}) bool { 102 if that == nil { 103 return this == nil 104 } 105 106 that1, ok := that.(*IndexQuery) 107 if !ok { 108 that2, ok := that.(IndexQuery) 109 if ok { 110 that1 = &that2 111 } else { 112 return false 113 } 114 } 115 if that1 == nil { 116 return this == nil 117 } else if this == nil { 118 return false 119 } 120 if this.Key != nil && that1.Key != nil { 121 if *this.Key != *that1.Key { 122 return false 123 } 124 } else if this.Key != nil { 125 return false 126 } else if that1.Key != nil { 127 return false 128 } 129 if this.Value != nil && that1.Value != nil { 130 if *this.Value != *that1.Value { 131 return false 132 } 133 } else if this.Value != nil { 134 return false 135 } else if that1.Value != nil { 136 return false 137 } 138 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 139 return false 140 } 141 return true 142 } 143 func (m *IndexQuery) Marshal() (dAtA []byte, err error) { 144 size := m.Size() 145 dAtA = make([]byte, size) 146 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 147 if err != nil { 148 return nil, err 149 } 150 return dAtA[:n], nil 151 } 152 153 func (m *IndexQuery) MarshalTo(dAtA []byte) (int, error) { 154 size := m.Size() 155 return m.MarshalToSizedBuffer(dAtA[:size]) 156 } 157 158 func (m *IndexQuery) MarshalToSizedBuffer(dAtA []byte) (int, error) { 159 i := len(dAtA) 160 _ = i 161 var l int 162 _ = l 163 if m.XXX_unrecognized != nil { 164 i -= len(m.XXX_unrecognized) 165 copy(dAtA[i:], m.XXX_unrecognized) 166 } 167 if m.Value != nil { 168 i -= len(*m.Value) 169 copy(dAtA[i:], *m.Value) 170 i = encodeVarintIndex(dAtA, i, uint64(len(*m.Value))) 171 i-- 172 dAtA[i] = 0x12 173 } 174 if m.Key != nil { 175 i -= len(*m.Key) 176 copy(dAtA[i:], *m.Key) 177 i = encodeVarintIndex(dAtA, i, uint64(len(*m.Key))) 178 i-- 179 dAtA[i] = 0xa 180 } 181 return len(dAtA) - i, nil 182 } 183 184 func encodeVarintIndex(dAtA []byte, offset int, v uint64) int { 185 offset -= sovIndex(v) 186 base := offset 187 for v >= 1<<7 { 188 dAtA[offset] = uint8(v&0x7f | 0x80) 189 v >>= 7 190 offset++ 191 } 192 dAtA[offset] = uint8(v) 193 return base 194 } 195 func NewPopulatedIndexQuery(r randyIndex, easy bool) *IndexQuery { 196 this := &IndexQuery{} 197 if r.Intn(5) != 0 { 198 v1 := string(randStringIndex(r)) 199 this.Key = &v1 200 } 201 if r.Intn(5) != 0 { 202 v2 := string(randStringIndex(r)) 203 this.Value = &v2 204 } 205 if !easy && r.Intn(10) != 0 { 206 this.XXX_unrecognized = randUnrecognizedIndex(r, 3) 207 } 208 return this 209 } 210 211 type randyIndex interface { 212 Float32() float32 213 Float64() float64 214 Int63() int64 215 Int31() int32 216 Uint32() uint32 217 Intn(n int) int 218 } 219 220 func randUTF8RuneIndex(r randyIndex) rune { 221 ru := r.Intn(62) 222 if ru < 10 { 223 return rune(ru + 48) 224 } else if ru < 36 { 225 return rune(ru + 55) 226 } 227 return rune(ru + 61) 228 } 229 func randStringIndex(r randyIndex) string { 230 v3 := r.Intn(100) 231 tmps := make([]rune, v3) 232 for i := 0; i < v3; i++ { 233 tmps[i] = randUTF8RuneIndex(r) 234 } 235 return string(tmps) 236 } 237 func randUnrecognizedIndex(r randyIndex, maxFieldNumber int) (dAtA []byte) { 238 l := r.Intn(5) 239 for i := 0; i < l; i++ { 240 wire := r.Intn(4) 241 if wire == 3 { 242 wire = 5 243 } 244 fieldNumber := maxFieldNumber + r.Intn(100) 245 dAtA = randFieldIndex(dAtA, r, fieldNumber, wire) 246 } 247 return dAtA 248 } 249 func randFieldIndex(dAtA []byte, r randyIndex, fieldNumber int, wire int) []byte { 250 key := uint32(fieldNumber)<<3 | uint32(wire) 251 switch wire { 252 case 0: 253 dAtA = encodeVarintPopulateIndex(dAtA, uint64(key)) 254 v4 := r.Int63() 255 if r.Intn(2) == 0 { 256 v4 *= -1 257 } 258 dAtA = encodeVarintPopulateIndex(dAtA, uint64(v4)) 259 case 1: 260 dAtA = encodeVarintPopulateIndex(dAtA, uint64(key)) 261 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 262 case 2: 263 dAtA = encodeVarintPopulateIndex(dAtA, uint64(key)) 264 ll := r.Intn(100) 265 dAtA = encodeVarintPopulateIndex(dAtA, uint64(ll)) 266 for j := 0; j < ll; j++ { 267 dAtA = append(dAtA, byte(r.Intn(256))) 268 } 269 default: 270 dAtA = encodeVarintPopulateIndex(dAtA, uint64(key)) 271 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 272 } 273 return dAtA 274 } 275 func encodeVarintPopulateIndex(dAtA []byte, v uint64) []byte { 276 for v >= 1<<7 { 277 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 278 v >>= 7 279 } 280 dAtA = append(dAtA, uint8(v)) 281 return dAtA 282 } 283 func (m *IndexQuery) Size() (n int) { 284 if m == nil { 285 return 0 286 } 287 var l int 288 _ = l 289 if m.Key != nil { 290 l = len(*m.Key) 291 n += 1 + l + sovIndex(uint64(l)) 292 } 293 if m.Value != nil { 294 l = len(*m.Value) 295 n += 1 + l + sovIndex(uint64(l)) 296 } 297 if m.XXX_unrecognized != nil { 298 n += len(m.XXX_unrecognized) 299 } 300 return n 301 } 302 303 func sovIndex(x uint64) (n int) { 304 return (math_bits.Len64(x|1) + 6) / 7 305 } 306 func sozIndex(x uint64) (n int) { 307 return sovIndex(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 308 } 309 func (m *IndexQuery) Unmarshal(dAtA []byte) error { 310 l := len(dAtA) 311 iNdEx := 0 312 for iNdEx < l { 313 preIndex := iNdEx 314 var wire uint64 315 for shift := uint(0); ; shift += 7 { 316 if shift >= 64 { 317 return ErrIntOverflowIndex 318 } 319 if iNdEx >= l { 320 return io.ErrUnexpectedEOF 321 } 322 b := dAtA[iNdEx] 323 iNdEx++ 324 wire |= uint64(b&0x7F) << shift 325 if b < 0x80 { 326 break 327 } 328 } 329 fieldNum := int32(wire >> 3) 330 wireType := int(wire & 0x7) 331 if wireType == 4 { 332 return fmt.Errorf("proto: IndexQuery: wiretype end group for non-group") 333 } 334 if fieldNum <= 0 { 335 return fmt.Errorf("proto: IndexQuery: illegal tag %d (wire type %d)", fieldNum, wire) 336 } 337 switch fieldNum { 338 case 1: 339 if wireType != 2 { 340 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 341 } 342 var stringLen uint64 343 for shift := uint(0); ; shift += 7 { 344 if shift >= 64 { 345 return ErrIntOverflowIndex 346 } 347 if iNdEx >= l { 348 return io.ErrUnexpectedEOF 349 } 350 b := dAtA[iNdEx] 351 iNdEx++ 352 stringLen |= uint64(b&0x7F) << shift 353 if b < 0x80 { 354 break 355 } 356 } 357 intStringLen := int(stringLen) 358 if intStringLen < 0 { 359 return ErrInvalidLengthIndex 360 } 361 postIndex := iNdEx + intStringLen 362 if postIndex < 0 { 363 return ErrInvalidLengthIndex 364 } 365 if postIndex > l { 366 return io.ErrUnexpectedEOF 367 } 368 s := string(dAtA[iNdEx:postIndex]) 369 m.Key = &s 370 iNdEx = postIndex 371 case 2: 372 if wireType != 2 { 373 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 374 } 375 var stringLen uint64 376 for shift := uint(0); ; shift += 7 { 377 if shift >= 64 { 378 return ErrIntOverflowIndex 379 } 380 if iNdEx >= l { 381 return io.ErrUnexpectedEOF 382 } 383 b := dAtA[iNdEx] 384 iNdEx++ 385 stringLen |= uint64(b&0x7F) << shift 386 if b < 0x80 { 387 break 388 } 389 } 390 intStringLen := int(stringLen) 391 if intStringLen < 0 { 392 return ErrInvalidLengthIndex 393 } 394 postIndex := iNdEx + intStringLen 395 if postIndex < 0 { 396 return ErrInvalidLengthIndex 397 } 398 if postIndex > l { 399 return io.ErrUnexpectedEOF 400 } 401 s := string(dAtA[iNdEx:postIndex]) 402 m.Value = &s 403 iNdEx = postIndex 404 default: 405 iNdEx = preIndex 406 skippy, err := skipIndex(dAtA[iNdEx:]) 407 if err != nil { 408 return err 409 } 410 if (skippy < 0) || (iNdEx+skippy) < 0 { 411 return ErrInvalidLengthIndex 412 } 413 if (iNdEx + skippy) > l { 414 return io.ErrUnexpectedEOF 415 } 416 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 417 iNdEx += skippy 418 } 419 } 420 421 if iNdEx > l { 422 return io.ErrUnexpectedEOF 423 } 424 return nil 425 } 426 func skipIndex(dAtA []byte) (n int, err error) { 427 l := len(dAtA) 428 iNdEx := 0 429 depth := 0 430 for iNdEx < l { 431 var wire uint64 432 for shift := uint(0); ; shift += 7 { 433 if shift >= 64 { 434 return 0, ErrIntOverflowIndex 435 } 436 if iNdEx >= l { 437 return 0, io.ErrUnexpectedEOF 438 } 439 b := dAtA[iNdEx] 440 iNdEx++ 441 wire |= (uint64(b) & 0x7F) << shift 442 if b < 0x80 { 443 break 444 } 445 } 446 wireType := int(wire & 0x7) 447 switch wireType { 448 case 0: 449 for shift := uint(0); ; shift += 7 { 450 if shift >= 64 { 451 return 0, ErrIntOverflowIndex 452 } 453 if iNdEx >= l { 454 return 0, io.ErrUnexpectedEOF 455 } 456 iNdEx++ 457 if dAtA[iNdEx-1] < 0x80 { 458 break 459 } 460 } 461 case 1: 462 iNdEx += 8 463 case 2: 464 var length int 465 for shift := uint(0); ; shift += 7 { 466 if shift >= 64 { 467 return 0, ErrIntOverflowIndex 468 } 469 if iNdEx >= l { 470 return 0, io.ErrUnexpectedEOF 471 } 472 b := dAtA[iNdEx] 473 iNdEx++ 474 length |= (int(b) & 0x7F) << shift 475 if b < 0x80 { 476 break 477 } 478 } 479 if length < 0 { 480 return 0, ErrInvalidLengthIndex 481 } 482 iNdEx += length 483 case 3: 484 depth++ 485 case 4: 486 if depth == 0 { 487 return 0, ErrUnexpectedEndOfGroupIndex 488 } 489 depth-- 490 case 5: 491 iNdEx += 4 492 default: 493 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 494 } 495 if iNdEx < 0 { 496 return 0, ErrInvalidLengthIndex 497 } 498 if depth == 0 { 499 return iNdEx, nil 500 } 501 } 502 return 0, io.ErrUnexpectedEOF 503 } 504 505 var ( 506 ErrInvalidLengthIndex = fmt.Errorf("proto: negative length found during unmarshaling") 507 ErrIntOverflowIndex = fmt.Errorf("proto: integer overflow") 508 ErrUnexpectedEndOfGroupIndex = fmt.Errorf("proto: unexpected end of group") 509 )