github.com/gogo/protobuf@v1.3.2/types/source_context.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: google/protobuf/source_context.proto 3 4 package types 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 proto "github.com/gogo/protobuf/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 reflect "reflect" 14 strings "strings" 15 ) 16 17 // Reference imports to suppress errors if they are not otherwise used. 18 var _ = proto.Marshal 19 var _ = fmt.Errorf 20 var _ = math.Inf 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the proto package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // proto package needs to be updated. 26 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28 // `SourceContext` represents information about the source of a 29 // protobuf element, like the file in which it is defined. 30 type SourceContext struct { 31 // The path-qualified name of the .proto file that contained the associated 32 // protobuf element. For example: `"google/protobuf/source_context.proto"`. 33 FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` 34 XXX_NoUnkeyedLiteral struct{} `json:"-"` 35 XXX_unrecognized []byte `json:"-"` 36 XXX_sizecache int32 `json:"-"` 37 } 38 39 func (m *SourceContext) Reset() { *m = SourceContext{} } 40 func (*SourceContext) ProtoMessage() {} 41 func (*SourceContext) Descriptor() ([]byte, []int) { 42 return fileDescriptor_b686cdb126d509db, []int{0} 43 } 44 func (m *SourceContext) XXX_Unmarshal(b []byte) error { 45 return m.Unmarshal(b) 46 } 47 func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 48 if deterministic { 49 return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic) 50 } else { 51 b = b[:cap(b)] 52 n, err := m.MarshalToSizedBuffer(b) 53 if err != nil { 54 return nil, err 55 } 56 return b[:n], nil 57 } 58 } 59 func (m *SourceContext) XXX_Merge(src proto.Message) { 60 xxx_messageInfo_SourceContext.Merge(m, src) 61 } 62 func (m *SourceContext) XXX_Size() int { 63 return m.Size() 64 } 65 func (m *SourceContext) XXX_DiscardUnknown() { 66 xxx_messageInfo_SourceContext.DiscardUnknown(m) 67 } 68 69 var xxx_messageInfo_SourceContext proto.InternalMessageInfo 70 71 func (m *SourceContext) GetFileName() string { 72 if m != nil { 73 return m.FileName 74 } 75 return "" 76 } 77 78 func (*SourceContext) XXX_MessageName() string { 79 return "google.protobuf.SourceContext" 80 } 81 func init() { 82 proto.RegisterType((*SourceContext)(nil), "google.protobuf.SourceContext") 83 } 84 85 func init() { 86 proto.RegisterFile("google/protobuf/source_context.proto", fileDescriptor_b686cdb126d509db) 87 } 88 89 var fileDescriptor_b686cdb126d509db = []byte{ 90 // 212 bytes of a gzipped FileDescriptorProto 91 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xcf, 0xcf, 0x4f, 92 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xce, 0x2f, 0x2d, 93 0x4a, 0x4e, 0x8d, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xad, 0x28, 0xd1, 0x03, 0x8b, 0x0b, 0xf1, 0x43, 94 0x54, 0xe9, 0xc1, 0x54, 0x29, 0xe9, 0x70, 0xf1, 0x06, 0x83, 0x15, 0x3a, 0x43, 0xd4, 0x09, 0x49, 95 0x73, 0x71, 0xa6, 0x65, 0xe6, 0xa4, 0xc6, 0xe7, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 96 0x70, 0x06, 0x71, 0x80, 0x04, 0xfc, 0x12, 0x73, 0x53, 0x9d, 0x3a, 0x19, 0x6f, 0x3c, 0x94, 0x63, 97 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 98 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 99 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x4b, 0x38, 0x39, 100 0x3f, 0x57, 0x0f, 0xcd, 0x56, 0x27, 0x21, 0x14, 0x3b, 0x03, 0x40, 0xc2, 0x01, 0x8c, 0x51, 0xac, 101 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 102 0x34, 0x05, 0x40, 0x35, 0xe9, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, 103 0x94, 0x25, 0xb1, 0x81, 0x4d, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x37, 0x2a, 0xa1, 104 0xf9, 0x00, 0x00, 0x00, 105 } 106 107 func (this *SourceContext) Compare(that interface{}) int { 108 if that == nil { 109 if this == nil { 110 return 0 111 } 112 return 1 113 } 114 115 that1, ok := that.(*SourceContext) 116 if !ok { 117 that2, ok := that.(SourceContext) 118 if ok { 119 that1 = &that2 120 } else { 121 return 1 122 } 123 } 124 if that1 == nil { 125 if this == nil { 126 return 0 127 } 128 return 1 129 } else if this == nil { 130 return -1 131 } 132 if this.FileName != that1.FileName { 133 if this.FileName < that1.FileName { 134 return -1 135 } 136 return 1 137 } 138 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 139 return c 140 } 141 return 0 142 } 143 func (this *SourceContext) Equal(that interface{}) bool { 144 if that == nil { 145 return this == nil 146 } 147 148 that1, ok := that.(*SourceContext) 149 if !ok { 150 that2, ok := that.(SourceContext) 151 if ok { 152 that1 = &that2 153 } else { 154 return false 155 } 156 } 157 if that1 == nil { 158 return this == nil 159 } else if this == nil { 160 return false 161 } 162 if this.FileName != that1.FileName { 163 return false 164 } 165 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 166 return false 167 } 168 return true 169 } 170 func (this *SourceContext) GoString() string { 171 if this == nil { 172 return "nil" 173 } 174 s := make([]string, 0, 5) 175 s = append(s, "&types.SourceContext{") 176 s = append(s, "FileName: "+fmt.Sprintf("%#v", this.FileName)+",\n") 177 if this.XXX_unrecognized != nil { 178 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 179 } 180 s = append(s, "}") 181 return strings.Join(s, "") 182 } 183 func valueToGoStringSourceContext(v interface{}, typ string) string { 184 rv := reflect.ValueOf(v) 185 if rv.IsNil() { 186 return "nil" 187 } 188 pv := reflect.Indirect(rv).Interface() 189 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 190 } 191 func (m *SourceContext) Marshal() (dAtA []byte, err error) { 192 size := m.Size() 193 dAtA = make([]byte, size) 194 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 195 if err != nil { 196 return nil, err 197 } 198 return dAtA[:n], nil 199 } 200 201 func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) { 202 size := m.Size() 203 return m.MarshalToSizedBuffer(dAtA[:size]) 204 } 205 206 func (m *SourceContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { 207 i := len(dAtA) 208 _ = i 209 var l int 210 _ = l 211 if m.XXX_unrecognized != nil { 212 i -= len(m.XXX_unrecognized) 213 copy(dAtA[i:], m.XXX_unrecognized) 214 } 215 if len(m.FileName) > 0 { 216 i -= len(m.FileName) 217 copy(dAtA[i:], m.FileName) 218 i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName))) 219 i-- 220 dAtA[i] = 0xa 221 } 222 return len(dAtA) - i, nil 223 } 224 225 func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int { 226 offset -= sovSourceContext(v) 227 base := offset 228 for v >= 1<<7 { 229 dAtA[offset] = uint8(v&0x7f | 0x80) 230 v >>= 7 231 offset++ 232 } 233 dAtA[offset] = uint8(v) 234 return base 235 } 236 func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext { 237 this := &SourceContext{} 238 this.FileName = string(randStringSourceContext(r)) 239 if !easy && r.Intn(10) != 0 { 240 this.XXX_unrecognized = randUnrecognizedSourceContext(r, 2) 241 } 242 return this 243 } 244 245 type randySourceContext interface { 246 Float32() float32 247 Float64() float64 248 Int63() int64 249 Int31() int32 250 Uint32() uint32 251 Intn(n int) int 252 } 253 254 func randUTF8RuneSourceContext(r randySourceContext) rune { 255 ru := r.Intn(62) 256 if ru < 10 { 257 return rune(ru + 48) 258 } else if ru < 36 { 259 return rune(ru + 55) 260 } 261 return rune(ru + 61) 262 } 263 func randStringSourceContext(r randySourceContext) string { 264 v1 := r.Intn(100) 265 tmps := make([]rune, v1) 266 for i := 0; i < v1; i++ { 267 tmps[i] = randUTF8RuneSourceContext(r) 268 } 269 return string(tmps) 270 } 271 func randUnrecognizedSourceContext(r randySourceContext, maxFieldNumber int) (dAtA []byte) { 272 l := r.Intn(5) 273 for i := 0; i < l; i++ { 274 wire := r.Intn(4) 275 if wire == 3 { 276 wire = 5 277 } 278 fieldNumber := maxFieldNumber + r.Intn(100) 279 dAtA = randFieldSourceContext(dAtA, r, fieldNumber, wire) 280 } 281 return dAtA 282 } 283 func randFieldSourceContext(dAtA []byte, r randySourceContext, fieldNumber int, wire int) []byte { 284 key := uint32(fieldNumber)<<3 | uint32(wire) 285 switch wire { 286 case 0: 287 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) 288 v2 := r.Int63() 289 if r.Intn(2) == 0 { 290 v2 *= -1 291 } 292 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(v2)) 293 case 1: 294 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) 295 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))) 296 case 2: 297 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) 298 ll := r.Intn(100) 299 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(ll)) 300 for j := 0; j < ll; j++ { 301 dAtA = append(dAtA, byte(r.Intn(256))) 302 } 303 default: 304 dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key)) 305 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 306 } 307 return dAtA 308 } 309 func encodeVarintPopulateSourceContext(dAtA []byte, v uint64) []byte { 310 for v >= 1<<7 { 311 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 312 v >>= 7 313 } 314 dAtA = append(dAtA, uint8(v)) 315 return dAtA 316 } 317 func (m *SourceContext) Size() (n int) { 318 if m == nil { 319 return 0 320 } 321 var l int 322 _ = l 323 l = len(m.FileName) 324 if l > 0 { 325 n += 1 + l + sovSourceContext(uint64(l)) 326 } 327 if m.XXX_unrecognized != nil { 328 n += len(m.XXX_unrecognized) 329 } 330 return n 331 } 332 333 func sovSourceContext(x uint64) (n int) { 334 return (math_bits.Len64(x|1) + 6) / 7 335 } 336 func sozSourceContext(x uint64) (n int) { 337 return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 338 } 339 func (this *SourceContext) String() string { 340 if this == nil { 341 return "nil" 342 } 343 s := strings.Join([]string{`&SourceContext{`, 344 `FileName:` + fmt.Sprintf("%v", this.FileName) + `,`, 345 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 346 `}`, 347 }, "") 348 return s 349 } 350 func valueToStringSourceContext(v interface{}) string { 351 rv := reflect.ValueOf(v) 352 if rv.IsNil() { 353 return "nil" 354 } 355 pv := reflect.Indirect(rv).Interface() 356 return fmt.Sprintf("*%v", pv) 357 } 358 func (m *SourceContext) 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 ErrIntOverflowSourceContext 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: SourceContext: wiretype end group for non-group") 382 } 383 if fieldNum <= 0 { 384 return fmt.Errorf("proto: SourceContext: 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 FileName", wireType) 390 } 391 var stringLen uint64 392 for shift := uint(0); ; shift += 7 { 393 if shift >= 64 { 394 return ErrIntOverflowSourceContext 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 ErrInvalidLengthSourceContext 409 } 410 postIndex := iNdEx + intStringLen 411 if postIndex < 0 { 412 return ErrInvalidLengthSourceContext 413 } 414 if postIndex > l { 415 return io.ErrUnexpectedEOF 416 } 417 m.FileName = string(dAtA[iNdEx:postIndex]) 418 iNdEx = postIndex 419 default: 420 iNdEx = preIndex 421 skippy, err := skipSourceContext(dAtA[iNdEx:]) 422 if err != nil { 423 return err 424 } 425 if (skippy < 0) || (iNdEx+skippy) < 0 { 426 return ErrInvalidLengthSourceContext 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 skipSourceContext(dAtA []byte) (n int, err error) { 442 l := len(dAtA) 443 iNdEx := 0 444 depth := 0 445 for iNdEx < l { 446 var wire uint64 447 for shift := uint(0); ; shift += 7 { 448 if shift >= 64 { 449 return 0, ErrIntOverflowSourceContext 450 } 451 if iNdEx >= l { 452 return 0, io.ErrUnexpectedEOF 453 } 454 b := dAtA[iNdEx] 455 iNdEx++ 456 wire |= (uint64(b) & 0x7F) << shift 457 if b < 0x80 { 458 break 459 } 460 } 461 wireType := int(wire & 0x7) 462 switch wireType { 463 case 0: 464 for shift := uint(0); ; shift += 7 { 465 if shift >= 64 { 466 return 0, ErrIntOverflowSourceContext 467 } 468 if iNdEx >= l { 469 return 0, io.ErrUnexpectedEOF 470 } 471 iNdEx++ 472 if dAtA[iNdEx-1] < 0x80 { 473 break 474 } 475 } 476 case 1: 477 iNdEx += 8 478 case 2: 479 var length int 480 for shift := uint(0); ; shift += 7 { 481 if shift >= 64 { 482 return 0, ErrIntOverflowSourceContext 483 } 484 if iNdEx >= l { 485 return 0, io.ErrUnexpectedEOF 486 } 487 b := dAtA[iNdEx] 488 iNdEx++ 489 length |= (int(b) & 0x7F) << shift 490 if b < 0x80 { 491 break 492 } 493 } 494 if length < 0 { 495 return 0, ErrInvalidLengthSourceContext 496 } 497 iNdEx += length 498 case 3: 499 depth++ 500 case 4: 501 if depth == 0 { 502 return 0, ErrUnexpectedEndOfGroupSourceContext 503 } 504 depth-- 505 case 5: 506 iNdEx += 4 507 default: 508 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 509 } 510 if iNdEx < 0 { 511 return 0, ErrInvalidLengthSourceContext 512 } 513 if depth == 0 { 514 return iNdEx, nil 515 } 516 } 517 return 0, io.ErrUnexpectedEOF 518 } 519 520 var ( 521 ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling") 522 ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow") 523 ErrUnexpectedEndOfGroupSourceContext = fmt.Errorf("proto: unexpected end of group") 524 )