github.com/ethersphere/bee/v2@v2.2.0/pkg/p2p/libp2p/internal/headers/pb/headers.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: headers.proto 3 4 package pb 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 ) 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25 type Headers struct { 26 Headers []*Header `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` 27 } 28 29 func (m *Headers) Reset() { *m = Headers{} } 30 func (m *Headers) String() string { return proto.CompactTextString(m) } 31 func (*Headers) ProtoMessage() {} 32 func (*Headers) Descriptor() ([]byte, []int) { 33 return fileDescriptor_9cec2a7af668f07b, []int{0} 34 } 35 func (m *Headers) XXX_Unmarshal(b []byte) error { 36 return m.Unmarshal(b) 37 } 38 func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 39 if deterministic { 40 return xxx_messageInfo_Headers.Marshal(b, m, deterministic) 41 } else { 42 b = b[:cap(b)] 43 n, err := m.MarshalToSizedBuffer(b) 44 if err != nil { 45 return nil, err 46 } 47 return b[:n], nil 48 } 49 } 50 func (m *Headers) XXX_Merge(src proto.Message) { 51 xxx_messageInfo_Headers.Merge(m, src) 52 } 53 func (m *Headers) XXX_Size() int { 54 return m.Size() 55 } 56 func (m *Headers) XXX_DiscardUnknown() { 57 xxx_messageInfo_Headers.DiscardUnknown(m) 58 } 59 60 var xxx_messageInfo_Headers proto.InternalMessageInfo 61 62 func (m *Headers) GetHeaders() []*Header { 63 if m != nil { 64 return m.Headers 65 } 66 return nil 67 } 68 69 type Header struct { 70 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 71 Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 72 } 73 74 func (m *Header) Reset() { *m = Header{} } 75 func (m *Header) String() string { return proto.CompactTextString(m) } 76 func (*Header) ProtoMessage() {} 77 func (*Header) Descriptor() ([]byte, []int) { 78 return fileDescriptor_9cec2a7af668f07b, []int{1} 79 } 80 func (m *Header) XXX_Unmarshal(b []byte) error { 81 return m.Unmarshal(b) 82 } 83 func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 84 if deterministic { 85 return xxx_messageInfo_Header.Marshal(b, m, deterministic) 86 } else { 87 b = b[:cap(b)] 88 n, err := m.MarshalToSizedBuffer(b) 89 if err != nil { 90 return nil, err 91 } 92 return b[:n], nil 93 } 94 } 95 func (m *Header) XXX_Merge(src proto.Message) { 96 xxx_messageInfo_Header.Merge(m, src) 97 } 98 func (m *Header) XXX_Size() int { 99 return m.Size() 100 } 101 func (m *Header) XXX_DiscardUnknown() { 102 xxx_messageInfo_Header.DiscardUnknown(m) 103 } 104 105 var xxx_messageInfo_Header proto.InternalMessageInfo 106 107 func (m *Header) GetKey() string { 108 if m != nil { 109 return m.Key 110 } 111 return "" 112 } 113 114 func (m *Header) GetValue() []byte { 115 if m != nil { 116 return m.Value 117 } 118 return nil 119 } 120 121 func init() { 122 proto.RegisterType((*Headers)(nil), "headers.Headers") 123 proto.RegisterType((*Header)(nil), "headers.Header") 124 } 125 126 func init() { proto.RegisterFile("headers.proto", fileDescriptor_9cec2a7af668f07b) } 127 128 var fileDescriptor_9cec2a7af668f07b = []byte{ 129 // 146 bytes of a gzipped FileDescriptorProto 130 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcd, 0x48, 0x4d, 0x4c, 131 0x49, 0x2d, 0x2a, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x87, 0x72, 0x95, 0x4c, 0xb8, 132 0xd8, 0x3d, 0x20, 0x4c, 0x21, 0x4d, 0x2e, 0x98, 0xa8, 0x04, 0xa3, 0x02, 0xb3, 0x06, 0xb7, 0x11, 133 0xbf, 0x1e, 0x4c, 0x13, 0x44, 0x49, 0x10, 0x5c, 0x97, 0x01, 0x17, 0x1b, 0x44, 0x48, 0x48, 0x80, 134 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc4, 0x14, 0x12, 0xe1, 135 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d, 0x95, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x09, 0x82, 0x70, 0x9c, 136 0x64, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 137 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x8a, 0xa9, 0x20, 0x29, 0x89, 138 0x0d, 0xec, 0x2a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x8f, 0xd4, 0x36, 0xa6, 0x00, 139 0x00, 0x00, 140 } 141 142 func (m *Headers) Marshal() (dAtA []byte, err error) { 143 size := m.Size() 144 dAtA = make([]byte, size) 145 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 146 if err != nil { 147 return nil, err 148 } 149 return dAtA[:n], nil 150 } 151 152 func (m *Headers) MarshalTo(dAtA []byte) (int, error) { 153 size := m.Size() 154 return m.MarshalToSizedBuffer(dAtA[:size]) 155 } 156 157 func (m *Headers) MarshalToSizedBuffer(dAtA []byte) (int, error) { 158 i := len(dAtA) 159 _ = i 160 var l int 161 _ = l 162 if len(m.Headers) > 0 { 163 for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { 164 { 165 size, err := m.Headers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 166 if err != nil { 167 return 0, err 168 } 169 i -= size 170 i = encodeVarintHeaders(dAtA, i, uint64(size)) 171 } 172 i-- 173 dAtA[i] = 0xa 174 } 175 } 176 return len(dAtA) - i, nil 177 } 178 179 func (m *Header) Marshal() (dAtA []byte, err error) { 180 size := m.Size() 181 dAtA = make([]byte, size) 182 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 183 if err != nil { 184 return nil, err 185 } 186 return dAtA[:n], nil 187 } 188 189 func (m *Header) MarshalTo(dAtA []byte) (int, error) { 190 size := m.Size() 191 return m.MarshalToSizedBuffer(dAtA[:size]) 192 } 193 194 func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { 195 i := len(dAtA) 196 _ = i 197 var l int 198 _ = l 199 if len(m.Value) > 0 { 200 i -= len(m.Value) 201 copy(dAtA[i:], m.Value) 202 i = encodeVarintHeaders(dAtA, i, uint64(len(m.Value))) 203 i-- 204 dAtA[i] = 0x12 205 } 206 if len(m.Key) > 0 { 207 i -= len(m.Key) 208 copy(dAtA[i:], m.Key) 209 i = encodeVarintHeaders(dAtA, i, uint64(len(m.Key))) 210 i-- 211 dAtA[i] = 0xa 212 } 213 return len(dAtA) - i, nil 214 } 215 216 func encodeVarintHeaders(dAtA []byte, offset int, v uint64) int { 217 offset -= sovHeaders(v) 218 base := offset 219 for v >= 1<<7 { 220 dAtA[offset] = uint8(v&0x7f | 0x80) 221 v >>= 7 222 offset++ 223 } 224 dAtA[offset] = uint8(v) 225 return base 226 } 227 func (m *Headers) Size() (n int) { 228 if m == nil { 229 return 0 230 } 231 var l int 232 _ = l 233 if len(m.Headers) > 0 { 234 for _, e := range m.Headers { 235 l = e.Size() 236 n += 1 + l + sovHeaders(uint64(l)) 237 } 238 } 239 return n 240 } 241 242 func (m *Header) Size() (n int) { 243 if m == nil { 244 return 0 245 } 246 var l int 247 _ = l 248 l = len(m.Key) 249 if l > 0 { 250 n += 1 + l + sovHeaders(uint64(l)) 251 } 252 l = len(m.Value) 253 if l > 0 { 254 n += 1 + l + sovHeaders(uint64(l)) 255 } 256 return n 257 } 258 259 func sovHeaders(x uint64) (n int) { 260 return (math_bits.Len64(x|1) + 6) / 7 261 } 262 func sozHeaders(x uint64) (n int) { 263 return sovHeaders(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 264 } 265 func (m *Headers) Unmarshal(dAtA []byte) error { 266 l := len(dAtA) 267 iNdEx := 0 268 for iNdEx < l { 269 preIndex := iNdEx 270 var wire uint64 271 for shift := uint(0); ; shift += 7 { 272 if shift >= 64 { 273 return ErrIntOverflowHeaders 274 } 275 if iNdEx >= l { 276 return io.ErrUnexpectedEOF 277 } 278 b := dAtA[iNdEx] 279 iNdEx++ 280 wire |= uint64(b&0x7F) << shift 281 if b < 0x80 { 282 break 283 } 284 } 285 fieldNum := int32(wire >> 3) 286 wireType := int(wire & 0x7) 287 if wireType == 4 { 288 return fmt.Errorf("proto: Headers: wiretype end group for non-group") 289 } 290 if fieldNum <= 0 { 291 return fmt.Errorf("proto: Headers: illegal tag %d (wire type %d)", fieldNum, wire) 292 } 293 switch fieldNum { 294 case 1: 295 if wireType != 2 { 296 return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) 297 } 298 var msglen int 299 for shift := uint(0); ; shift += 7 { 300 if shift >= 64 { 301 return ErrIntOverflowHeaders 302 } 303 if iNdEx >= l { 304 return io.ErrUnexpectedEOF 305 } 306 b := dAtA[iNdEx] 307 iNdEx++ 308 msglen |= int(b&0x7F) << shift 309 if b < 0x80 { 310 break 311 } 312 } 313 if msglen < 0 { 314 return ErrInvalidLengthHeaders 315 } 316 postIndex := iNdEx + msglen 317 if postIndex < 0 { 318 return ErrInvalidLengthHeaders 319 } 320 if postIndex > l { 321 return io.ErrUnexpectedEOF 322 } 323 m.Headers = append(m.Headers, &Header{}) 324 if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 325 return err 326 } 327 iNdEx = postIndex 328 default: 329 iNdEx = preIndex 330 skippy, err := skipHeaders(dAtA[iNdEx:]) 331 if err != nil { 332 return err 333 } 334 if skippy < 0 { 335 return ErrInvalidLengthHeaders 336 } 337 if (iNdEx + skippy) < 0 { 338 return ErrInvalidLengthHeaders 339 } 340 if (iNdEx + skippy) > l { 341 return io.ErrUnexpectedEOF 342 } 343 iNdEx += skippy 344 } 345 } 346 347 if iNdEx > l { 348 return io.ErrUnexpectedEOF 349 } 350 return nil 351 } 352 func (m *Header) Unmarshal(dAtA []byte) error { 353 l := len(dAtA) 354 iNdEx := 0 355 for iNdEx < l { 356 preIndex := iNdEx 357 var wire uint64 358 for shift := uint(0); ; shift += 7 { 359 if shift >= 64 { 360 return ErrIntOverflowHeaders 361 } 362 if iNdEx >= l { 363 return io.ErrUnexpectedEOF 364 } 365 b := dAtA[iNdEx] 366 iNdEx++ 367 wire |= uint64(b&0x7F) << shift 368 if b < 0x80 { 369 break 370 } 371 } 372 fieldNum := int32(wire >> 3) 373 wireType := int(wire & 0x7) 374 if wireType == 4 { 375 return fmt.Errorf("proto: Header: wiretype end group for non-group") 376 } 377 if fieldNum <= 0 { 378 return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) 379 } 380 switch fieldNum { 381 case 1: 382 if wireType != 2 { 383 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 384 } 385 var stringLen uint64 386 for shift := uint(0); ; shift += 7 { 387 if shift >= 64 { 388 return ErrIntOverflowHeaders 389 } 390 if iNdEx >= l { 391 return io.ErrUnexpectedEOF 392 } 393 b := dAtA[iNdEx] 394 iNdEx++ 395 stringLen |= uint64(b&0x7F) << shift 396 if b < 0x80 { 397 break 398 } 399 } 400 intStringLen := int(stringLen) 401 if intStringLen < 0 { 402 return ErrInvalidLengthHeaders 403 } 404 postIndex := iNdEx + intStringLen 405 if postIndex < 0 { 406 return ErrInvalidLengthHeaders 407 } 408 if postIndex > l { 409 return io.ErrUnexpectedEOF 410 } 411 m.Key = string(dAtA[iNdEx:postIndex]) 412 iNdEx = postIndex 413 case 2: 414 if wireType != 2 { 415 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 416 } 417 var byteLen int 418 for shift := uint(0); ; shift += 7 { 419 if shift >= 64 { 420 return ErrIntOverflowHeaders 421 } 422 if iNdEx >= l { 423 return io.ErrUnexpectedEOF 424 } 425 b := dAtA[iNdEx] 426 iNdEx++ 427 byteLen |= int(b&0x7F) << shift 428 if b < 0x80 { 429 break 430 } 431 } 432 if byteLen < 0 { 433 return ErrInvalidLengthHeaders 434 } 435 postIndex := iNdEx + byteLen 436 if postIndex < 0 { 437 return ErrInvalidLengthHeaders 438 } 439 if postIndex > l { 440 return io.ErrUnexpectedEOF 441 } 442 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) 443 if m.Value == nil { 444 m.Value = []byte{} 445 } 446 iNdEx = postIndex 447 default: 448 iNdEx = preIndex 449 skippy, err := skipHeaders(dAtA[iNdEx:]) 450 if err != nil { 451 return err 452 } 453 if skippy < 0 { 454 return ErrInvalidLengthHeaders 455 } 456 if (iNdEx + skippy) < 0 { 457 return ErrInvalidLengthHeaders 458 } 459 if (iNdEx + skippy) > l { 460 return io.ErrUnexpectedEOF 461 } 462 iNdEx += skippy 463 } 464 } 465 466 if iNdEx > l { 467 return io.ErrUnexpectedEOF 468 } 469 return nil 470 } 471 func skipHeaders(dAtA []byte) (n int, err error) { 472 l := len(dAtA) 473 iNdEx := 0 474 depth := 0 475 for iNdEx < l { 476 var wire uint64 477 for shift := uint(0); ; shift += 7 { 478 if shift >= 64 { 479 return 0, ErrIntOverflowHeaders 480 } 481 if iNdEx >= l { 482 return 0, io.ErrUnexpectedEOF 483 } 484 b := dAtA[iNdEx] 485 iNdEx++ 486 wire |= (uint64(b) & 0x7F) << shift 487 if b < 0x80 { 488 break 489 } 490 } 491 wireType := int(wire & 0x7) 492 switch wireType { 493 case 0: 494 for shift := uint(0); ; shift += 7 { 495 if shift >= 64 { 496 return 0, ErrIntOverflowHeaders 497 } 498 if iNdEx >= l { 499 return 0, io.ErrUnexpectedEOF 500 } 501 iNdEx++ 502 if dAtA[iNdEx-1] < 0x80 { 503 break 504 } 505 } 506 case 1: 507 iNdEx += 8 508 case 2: 509 var length int 510 for shift := uint(0); ; shift += 7 { 511 if shift >= 64 { 512 return 0, ErrIntOverflowHeaders 513 } 514 if iNdEx >= l { 515 return 0, io.ErrUnexpectedEOF 516 } 517 b := dAtA[iNdEx] 518 iNdEx++ 519 length |= (int(b) & 0x7F) << shift 520 if b < 0x80 { 521 break 522 } 523 } 524 if length < 0 { 525 return 0, ErrInvalidLengthHeaders 526 } 527 iNdEx += length 528 case 3: 529 depth++ 530 case 4: 531 if depth == 0 { 532 return 0, ErrUnexpectedEndOfGroupHeaders 533 } 534 depth-- 535 case 5: 536 iNdEx += 4 537 default: 538 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 539 } 540 if iNdEx < 0 { 541 return 0, ErrInvalidLengthHeaders 542 } 543 if depth == 0 { 544 return iNdEx, nil 545 } 546 } 547 return 0, io.ErrUnexpectedEOF 548 } 549 550 var ( 551 ErrInvalidLengthHeaders = fmt.Errorf("proto: negative length found during unmarshaling") 552 ErrIntOverflowHeaders = fmt.Errorf("proto: integer overflow") 553 ErrUnexpectedEndOfGroupHeaders = fmt.Errorf("proto: unexpected end of group") 554 )