github.com/ethersphere/bee/v2@v2.2.0/pkg/pullsync/pb/pullsync.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: pullsync.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 Syn struct { 26 } 27 28 func (m *Syn) Reset() { *m = Syn{} } 29 func (m *Syn) String() string { return proto.CompactTextString(m) } 30 func (*Syn) ProtoMessage() {} 31 func (*Syn) Descriptor() ([]byte, []int) { 32 return fileDescriptor_d1dee042cf9c065c, []int{0} 33 } 34 func (m *Syn) XXX_Unmarshal(b []byte) error { 35 return m.Unmarshal(b) 36 } 37 func (m *Syn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 38 if deterministic { 39 return xxx_messageInfo_Syn.Marshal(b, m, deterministic) 40 } else { 41 b = b[:cap(b)] 42 n, err := m.MarshalToSizedBuffer(b) 43 if err != nil { 44 return nil, err 45 } 46 return b[:n], nil 47 } 48 } 49 func (m *Syn) XXX_Merge(src proto.Message) { 50 xxx_messageInfo_Syn.Merge(m, src) 51 } 52 func (m *Syn) XXX_Size() int { 53 return m.Size() 54 } 55 func (m *Syn) XXX_DiscardUnknown() { 56 xxx_messageInfo_Syn.DiscardUnknown(m) 57 } 58 59 var xxx_messageInfo_Syn proto.InternalMessageInfo 60 61 type Ack struct { 62 Cursors []uint64 `protobuf:"varint,1,rep,packed,name=Cursors,proto3" json:"Cursors,omitempty"` 63 Epoch uint64 `protobuf:"varint,2,opt,name=Epoch,proto3" json:"Epoch,omitempty"` 64 } 65 66 func (m *Ack) Reset() { *m = Ack{} } 67 func (m *Ack) String() string { return proto.CompactTextString(m) } 68 func (*Ack) ProtoMessage() {} 69 func (*Ack) Descriptor() ([]byte, []int) { 70 return fileDescriptor_d1dee042cf9c065c, []int{1} 71 } 72 func (m *Ack) XXX_Unmarshal(b []byte) error { 73 return m.Unmarshal(b) 74 } 75 func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 76 if deterministic { 77 return xxx_messageInfo_Ack.Marshal(b, m, deterministic) 78 } else { 79 b = b[:cap(b)] 80 n, err := m.MarshalToSizedBuffer(b) 81 if err != nil { 82 return nil, err 83 } 84 return b[:n], nil 85 } 86 } 87 func (m *Ack) XXX_Merge(src proto.Message) { 88 xxx_messageInfo_Ack.Merge(m, src) 89 } 90 func (m *Ack) XXX_Size() int { 91 return m.Size() 92 } 93 func (m *Ack) XXX_DiscardUnknown() { 94 xxx_messageInfo_Ack.DiscardUnknown(m) 95 } 96 97 var xxx_messageInfo_Ack proto.InternalMessageInfo 98 99 func (m *Ack) GetCursors() []uint64 { 100 if m != nil { 101 return m.Cursors 102 } 103 return nil 104 } 105 106 func (m *Ack) GetEpoch() uint64 { 107 if m != nil { 108 return m.Epoch 109 } 110 return 0 111 } 112 113 type Get struct { 114 Bin int32 `protobuf:"varint,1,opt,name=Bin,proto3" json:"Bin,omitempty"` 115 Start uint64 `protobuf:"varint,2,opt,name=Start,proto3" json:"Start,omitempty"` 116 } 117 118 func (m *Get) Reset() { *m = Get{} } 119 func (m *Get) String() string { return proto.CompactTextString(m) } 120 func (*Get) ProtoMessage() {} 121 func (*Get) Descriptor() ([]byte, []int) { 122 return fileDescriptor_d1dee042cf9c065c, []int{2} 123 } 124 func (m *Get) XXX_Unmarshal(b []byte) error { 125 return m.Unmarshal(b) 126 } 127 func (m *Get) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 128 if deterministic { 129 return xxx_messageInfo_Get.Marshal(b, m, deterministic) 130 } else { 131 b = b[:cap(b)] 132 n, err := m.MarshalToSizedBuffer(b) 133 if err != nil { 134 return nil, err 135 } 136 return b[:n], nil 137 } 138 } 139 func (m *Get) XXX_Merge(src proto.Message) { 140 xxx_messageInfo_Get.Merge(m, src) 141 } 142 func (m *Get) XXX_Size() int { 143 return m.Size() 144 } 145 func (m *Get) XXX_DiscardUnknown() { 146 xxx_messageInfo_Get.DiscardUnknown(m) 147 } 148 149 var xxx_messageInfo_Get proto.InternalMessageInfo 150 151 func (m *Get) GetBin() int32 { 152 if m != nil { 153 return m.Bin 154 } 155 return 0 156 } 157 158 func (m *Get) GetStart() uint64 { 159 if m != nil { 160 return m.Start 161 } 162 return 0 163 } 164 165 type Chunk struct { 166 Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` 167 BatchID []byte `protobuf:"bytes,2,opt,name=BatchID,proto3" json:"BatchID,omitempty"` 168 StampHash []byte `protobuf:"bytes,3,opt,name=StampHash,proto3" json:"StampHash,omitempty"` 169 } 170 171 func (m *Chunk) Reset() { *m = Chunk{} } 172 func (m *Chunk) String() string { return proto.CompactTextString(m) } 173 func (*Chunk) ProtoMessage() {} 174 func (*Chunk) Descriptor() ([]byte, []int) { 175 return fileDescriptor_d1dee042cf9c065c, []int{3} 176 } 177 func (m *Chunk) XXX_Unmarshal(b []byte) error { 178 return m.Unmarshal(b) 179 } 180 func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 181 if deterministic { 182 return xxx_messageInfo_Chunk.Marshal(b, m, deterministic) 183 } else { 184 b = b[:cap(b)] 185 n, err := m.MarshalToSizedBuffer(b) 186 if err != nil { 187 return nil, err 188 } 189 return b[:n], nil 190 } 191 } 192 func (m *Chunk) XXX_Merge(src proto.Message) { 193 xxx_messageInfo_Chunk.Merge(m, src) 194 } 195 func (m *Chunk) XXX_Size() int { 196 return m.Size() 197 } 198 func (m *Chunk) XXX_DiscardUnknown() { 199 xxx_messageInfo_Chunk.DiscardUnknown(m) 200 } 201 202 var xxx_messageInfo_Chunk proto.InternalMessageInfo 203 204 func (m *Chunk) GetAddress() []byte { 205 if m != nil { 206 return m.Address 207 } 208 return nil 209 } 210 211 func (m *Chunk) GetBatchID() []byte { 212 if m != nil { 213 return m.BatchID 214 } 215 return nil 216 } 217 218 func (m *Chunk) GetStampHash() []byte { 219 if m != nil { 220 return m.StampHash 221 } 222 return nil 223 } 224 225 type Offer struct { 226 Topmost uint64 `protobuf:"varint,1,opt,name=Topmost,proto3" json:"Topmost,omitempty"` 227 Chunks []*Chunk `protobuf:"bytes,2,rep,name=Chunks,proto3" json:"Chunks,omitempty"` 228 } 229 230 func (m *Offer) Reset() { *m = Offer{} } 231 func (m *Offer) String() string { return proto.CompactTextString(m) } 232 func (*Offer) ProtoMessage() {} 233 func (*Offer) Descriptor() ([]byte, []int) { 234 return fileDescriptor_d1dee042cf9c065c, []int{4} 235 } 236 func (m *Offer) XXX_Unmarshal(b []byte) error { 237 return m.Unmarshal(b) 238 } 239 func (m *Offer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 240 if deterministic { 241 return xxx_messageInfo_Offer.Marshal(b, m, deterministic) 242 } else { 243 b = b[:cap(b)] 244 n, err := m.MarshalToSizedBuffer(b) 245 if err != nil { 246 return nil, err 247 } 248 return b[:n], nil 249 } 250 } 251 func (m *Offer) XXX_Merge(src proto.Message) { 252 xxx_messageInfo_Offer.Merge(m, src) 253 } 254 func (m *Offer) XXX_Size() int { 255 return m.Size() 256 } 257 func (m *Offer) XXX_DiscardUnknown() { 258 xxx_messageInfo_Offer.DiscardUnknown(m) 259 } 260 261 var xxx_messageInfo_Offer proto.InternalMessageInfo 262 263 func (m *Offer) GetTopmost() uint64 { 264 if m != nil { 265 return m.Topmost 266 } 267 return 0 268 } 269 270 func (m *Offer) GetChunks() []*Chunk { 271 if m != nil { 272 return m.Chunks 273 } 274 return nil 275 } 276 277 type Want struct { 278 BitVector []byte `protobuf:"bytes,1,opt,name=BitVector,proto3" json:"BitVector,omitempty"` 279 } 280 281 func (m *Want) Reset() { *m = Want{} } 282 func (m *Want) String() string { return proto.CompactTextString(m) } 283 func (*Want) ProtoMessage() {} 284 func (*Want) Descriptor() ([]byte, []int) { 285 return fileDescriptor_d1dee042cf9c065c, []int{5} 286 } 287 func (m *Want) XXX_Unmarshal(b []byte) error { 288 return m.Unmarshal(b) 289 } 290 func (m *Want) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 291 if deterministic { 292 return xxx_messageInfo_Want.Marshal(b, m, deterministic) 293 } else { 294 b = b[:cap(b)] 295 n, err := m.MarshalToSizedBuffer(b) 296 if err != nil { 297 return nil, err 298 } 299 return b[:n], nil 300 } 301 } 302 func (m *Want) XXX_Merge(src proto.Message) { 303 xxx_messageInfo_Want.Merge(m, src) 304 } 305 func (m *Want) XXX_Size() int { 306 return m.Size() 307 } 308 func (m *Want) XXX_DiscardUnknown() { 309 xxx_messageInfo_Want.DiscardUnknown(m) 310 } 311 312 var xxx_messageInfo_Want proto.InternalMessageInfo 313 314 func (m *Want) GetBitVector() []byte { 315 if m != nil { 316 return m.BitVector 317 } 318 return nil 319 } 320 321 type Delivery struct { 322 Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` 323 Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` 324 Stamp []byte `protobuf:"bytes,3,opt,name=Stamp,proto3" json:"Stamp,omitempty"` 325 } 326 327 func (m *Delivery) Reset() { *m = Delivery{} } 328 func (m *Delivery) String() string { return proto.CompactTextString(m) } 329 func (*Delivery) ProtoMessage() {} 330 func (*Delivery) Descriptor() ([]byte, []int) { 331 return fileDescriptor_d1dee042cf9c065c, []int{6} 332 } 333 func (m *Delivery) XXX_Unmarshal(b []byte) error { 334 return m.Unmarshal(b) 335 } 336 func (m *Delivery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 337 if deterministic { 338 return xxx_messageInfo_Delivery.Marshal(b, m, deterministic) 339 } else { 340 b = b[:cap(b)] 341 n, err := m.MarshalToSizedBuffer(b) 342 if err != nil { 343 return nil, err 344 } 345 return b[:n], nil 346 } 347 } 348 func (m *Delivery) XXX_Merge(src proto.Message) { 349 xxx_messageInfo_Delivery.Merge(m, src) 350 } 351 func (m *Delivery) XXX_Size() int { 352 return m.Size() 353 } 354 func (m *Delivery) XXX_DiscardUnknown() { 355 xxx_messageInfo_Delivery.DiscardUnknown(m) 356 } 357 358 var xxx_messageInfo_Delivery proto.InternalMessageInfo 359 360 func (m *Delivery) GetAddress() []byte { 361 if m != nil { 362 return m.Address 363 } 364 return nil 365 } 366 367 func (m *Delivery) GetData() []byte { 368 if m != nil { 369 return m.Data 370 } 371 return nil 372 } 373 374 func (m *Delivery) GetStamp() []byte { 375 if m != nil { 376 return m.Stamp 377 } 378 return nil 379 } 380 381 func init() { 382 proto.RegisterType((*Syn)(nil), "pullsync.Syn") 383 proto.RegisterType((*Ack)(nil), "pullsync.Ack") 384 proto.RegisterType((*Get)(nil), "pullsync.Get") 385 proto.RegisterType((*Chunk)(nil), "pullsync.Chunk") 386 proto.RegisterType((*Offer)(nil), "pullsync.Offer") 387 proto.RegisterType((*Want)(nil), "pullsync.Want") 388 proto.RegisterType((*Delivery)(nil), "pullsync.Delivery") 389 } 390 391 func init() { proto.RegisterFile("pullsync.proto", fileDescriptor_d1dee042cf9c065c) } 392 393 var fileDescriptor_d1dee042cf9c065c = []byte{ 394 // 319 bytes of a gzipped FileDescriptorProto 395 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xbb, 0x4e, 0xc3, 0x30, 396 0x14, 0x86, 0xeb, 0x3a, 0x29, 0xe5, 0x50, 0x01, 0xb2, 0x18, 0x32, 0x54, 0x51, 0x64, 0x21, 0x91, 397 0x85, 0x0e, 0x20, 0x1e, 0xa0, 0x69, 0x11, 0x97, 0x01, 0x24, 0x17, 0x81, 0x60, 0x73, 0xd3, 0x54, 398 0xa9, 0x68, 0x63, 0xcb, 0x76, 0x91, 0xfa, 0x16, 0x3c, 0x16, 0x63, 0x47, 0x46, 0xd4, 0xbc, 0x08, 399 0x8a, 0x1b, 0xd3, 0x8d, 0xed, 0x7c, 0xe7, 0xf6, 0xfb, 0x3f, 0x86, 0x43, 0xb9, 0x9c, 0xcf, 0xf5, 400 0xaa, 0x48, 0x7b, 0x52, 0x09, 0x23, 0x48, 0xdb, 0x31, 0xf5, 0x01, 0x8f, 0x56, 0x05, 0xbd, 0x02, 401 0xdc, 0x4f, 0xdf, 0x49, 0x00, 0x7b, 0x83, 0xa5, 0xd2, 0x42, 0xe9, 0x00, 0x45, 0x38, 0xf6, 0x98, 402 0x43, 0x72, 0x02, 0xfe, 0xb5, 0x14, 0x69, 0x1e, 0x34, 0x23, 0x14, 0x7b, 0x6c, 0x0b, 0xf4, 0x1c, 403 0xf0, 0x4d, 0x66, 0xc8, 0x31, 0xe0, 0x64, 0x56, 0x04, 0x28, 0x42, 0xb1, 0xcf, 0xaa, 0xb0, 0x6a, 404 0x1f, 0x19, 0xae, 0x8c, 0x6b, 0xb7, 0x40, 0x5f, 0xc1, 0x1f, 0xe4, 0xcb, 0xc2, 0xea, 0xf4, 0x27, 405 0x13, 0x95, 0x69, 0x6d, 0x87, 0x3a, 0xcc, 0x61, 0x55, 0x49, 0xb8, 0x49, 0xf3, 0xbb, 0xa1, 0x1d, 406 0xed, 0x30, 0x87, 0xa4, 0x0b, 0xfb, 0x23, 0xc3, 0x17, 0xf2, 0x96, 0xeb, 0x3c, 0xc0, 0xb6, 0xb6, 407 0x4b, 0xd0, 0x7b, 0xf0, 0x1f, 0xa7, 0xd3, 0x4c, 0x55, 0x0b, 0x9e, 0x84, 0x5c, 0x08, 0x6d, 0xec, 408 0x6a, 0x8f, 0x39, 0x24, 0x67, 0xd0, 0xb2, 0xea, 0x3a, 0x68, 0x46, 0x38, 0x3e, 0xb8, 0x38, 0xea, 409 0xfd, 0x5d, 0xc5, 0xe6, 0x59, 0x5d, 0xa6, 0xa7, 0xe0, 0xbd, 0xf0, 0xc2, 0x54, 0x8a, 0xc9, 0xcc, 410 0x3c, 0x67, 0xa9, 0x11, 0xaa, 0x7e, 0xe7, 0x2e, 0x41, 0x1f, 0xa0, 0x3d, 0xcc, 0xe6, 0xb3, 0x8f, 411 0x4c, 0xad, 0xfe, 0xf1, 0x43, 0xc0, 0x1b, 0x72, 0xc3, 0x6b, 0x33, 0x36, 0xae, 0x8f, 0xb3, 0x90, 412 0xb5, 0x8b, 0x2d, 0x24, 0xdd, 0xaf, 0x4d, 0x88, 0xd6, 0x9b, 0x10, 0xfd, 0x6c, 0x42, 0xf4, 0x59, 413 0x86, 0x8d, 0x75, 0x19, 0x36, 0xbe, 0xcb, 0xb0, 0xf1, 0xd6, 0x94, 0xe3, 0x71, 0xcb, 0x7e, 0xdc, 414 0xe5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x02, 0x2f, 0x9a, 0xca, 0x01, 0x00, 0x00, 415 } 416 417 func (m *Syn) Marshal() (dAtA []byte, err error) { 418 size := m.Size() 419 dAtA = make([]byte, size) 420 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 421 if err != nil { 422 return nil, err 423 } 424 return dAtA[:n], nil 425 } 426 427 func (m *Syn) MarshalTo(dAtA []byte) (int, error) { 428 size := m.Size() 429 return m.MarshalToSizedBuffer(dAtA[:size]) 430 } 431 432 func (m *Syn) MarshalToSizedBuffer(dAtA []byte) (int, error) { 433 i := len(dAtA) 434 _ = i 435 var l int 436 _ = l 437 return len(dAtA) - i, nil 438 } 439 440 func (m *Ack) Marshal() (dAtA []byte, err error) { 441 size := m.Size() 442 dAtA = make([]byte, size) 443 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 444 if err != nil { 445 return nil, err 446 } 447 return dAtA[:n], nil 448 } 449 450 func (m *Ack) MarshalTo(dAtA []byte) (int, error) { 451 size := m.Size() 452 return m.MarshalToSizedBuffer(dAtA[:size]) 453 } 454 455 func (m *Ack) MarshalToSizedBuffer(dAtA []byte) (int, error) { 456 i := len(dAtA) 457 _ = i 458 var l int 459 _ = l 460 if m.Epoch != 0 { 461 i = encodeVarintPullsync(dAtA, i, uint64(m.Epoch)) 462 i-- 463 dAtA[i] = 0x10 464 } 465 if len(m.Cursors) > 0 { 466 dAtA2 := make([]byte, len(m.Cursors)*10) 467 var j1 int 468 for _, num := range m.Cursors { 469 for num >= 1<<7 { 470 dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) 471 num >>= 7 472 j1++ 473 } 474 dAtA2[j1] = uint8(num) 475 j1++ 476 } 477 i -= j1 478 copy(dAtA[i:], dAtA2[:j1]) 479 i = encodeVarintPullsync(dAtA, i, uint64(j1)) 480 i-- 481 dAtA[i] = 0xa 482 } 483 return len(dAtA) - i, nil 484 } 485 486 func (m *Get) Marshal() (dAtA []byte, err error) { 487 size := m.Size() 488 dAtA = make([]byte, size) 489 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 490 if err != nil { 491 return nil, err 492 } 493 return dAtA[:n], nil 494 } 495 496 func (m *Get) MarshalTo(dAtA []byte) (int, error) { 497 size := m.Size() 498 return m.MarshalToSizedBuffer(dAtA[:size]) 499 } 500 501 func (m *Get) MarshalToSizedBuffer(dAtA []byte) (int, error) { 502 i := len(dAtA) 503 _ = i 504 var l int 505 _ = l 506 if m.Start != 0 { 507 i = encodeVarintPullsync(dAtA, i, uint64(m.Start)) 508 i-- 509 dAtA[i] = 0x10 510 } 511 if m.Bin != 0 { 512 i = encodeVarintPullsync(dAtA, i, uint64(m.Bin)) 513 i-- 514 dAtA[i] = 0x8 515 } 516 return len(dAtA) - i, nil 517 } 518 519 func (m *Chunk) Marshal() (dAtA []byte, err error) { 520 size := m.Size() 521 dAtA = make([]byte, size) 522 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 523 if err != nil { 524 return nil, err 525 } 526 return dAtA[:n], nil 527 } 528 529 func (m *Chunk) MarshalTo(dAtA []byte) (int, error) { 530 size := m.Size() 531 return m.MarshalToSizedBuffer(dAtA[:size]) 532 } 533 534 func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { 535 i := len(dAtA) 536 _ = i 537 var l int 538 _ = l 539 if len(m.StampHash) > 0 { 540 i -= len(m.StampHash) 541 copy(dAtA[i:], m.StampHash) 542 i = encodeVarintPullsync(dAtA, i, uint64(len(m.StampHash))) 543 i-- 544 dAtA[i] = 0x1a 545 } 546 if len(m.BatchID) > 0 { 547 i -= len(m.BatchID) 548 copy(dAtA[i:], m.BatchID) 549 i = encodeVarintPullsync(dAtA, i, uint64(len(m.BatchID))) 550 i-- 551 dAtA[i] = 0x12 552 } 553 if len(m.Address) > 0 { 554 i -= len(m.Address) 555 copy(dAtA[i:], m.Address) 556 i = encodeVarintPullsync(dAtA, i, uint64(len(m.Address))) 557 i-- 558 dAtA[i] = 0xa 559 } 560 return len(dAtA) - i, nil 561 } 562 563 func (m *Offer) Marshal() (dAtA []byte, err error) { 564 size := m.Size() 565 dAtA = make([]byte, size) 566 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 567 if err != nil { 568 return nil, err 569 } 570 return dAtA[:n], nil 571 } 572 573 func (m *Offer) MarshalTo(dAtA []byte) (int, error) { 574 size := m.Size() 575 return m.MarshalToSizedBuffer(dAtA[:size]) 576 } 577 578 func (m *Offer) MarshalToSizedBuffer(dAtA []byte) (int, error) { 579 i := len(dAtA) 580 _ = i 581 var l int 582 _ = l 583 if len(m.Chunks) > 0 { 584 for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { 585 { 586 size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 587 if err != nil { 588 return 0, err 589 } 590 i -= size 591 i = encodeVarintPullsync(dAtA, i, uint64(size)) 592 } 593 i-- 594 dAtA[i] = 0x12 595 } 596 } 597 if m.Topmost != 0 { 598 i = encodeVarintPullsync(dAtA, i, uint64(m.Topmost)) 599 i-- 600 dAtA[i] = 0x8 601 } 602 return len(dAtA) - i, nil 603 } 604 605 func (m *Want) Marshal() (dAtA []byte, err error) { 606 size := m.Size() 607 dAtA = make([]byte, size) 608 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 609 if err != nil { 610 return nil, err 611 } 612 return dAtA[:n], nil 613 } 614 615 func (m *Want) MarshalTo(dAtA []byte) (int, error) { 616 size := m.Size() 617 return m.MarshalToSizedBuffer(dAtA[:size]) 618 } 619 620 func (m *Want) MarshalToSizedBuffer(dAtA []byte) (int, error) { 621 i := len(dAtA) 622 _ = i 623 var l int 624 _ = l 625 if len(m.BitVector) > 0 { 626 i -= len(m.BitVector) 627 copy(dAtA[i:], m.BitVector) 628 i = encodeVarintPullsync(dAtA, i, uint64(len(m.BitVector))) 629 i-- 630 dAtA[i] = 0xa 631 } 632 return len(dAtA) - i, nil 633 } 634 635 func (m *Delivery) Marshal() (dAtA []byte, err error) { 636 size := m.Size() 637 dAtA = make([]byte, size) 638 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 639 if err != nil { 640 return nil, err 641 } 642 return dAtA[:n], nil 643 } 644 645 func (m *Delivery) MarshalTo(dAtA []byte) (int, error) { 646 size := m.Size() 647 return m.MarshalToSizedBuffer(dAtA[:size]) 648 } 649 650 func (m *Delivery) MarshalToSizedBuffer(dAtA []byte) (int, error) { 651 i := len(dAtA) 652 _ = i 653 var l int 654 _ = l 655 if len(m.Stamp) > 0 { 656 i -= len(m.Stamp) 657 copy(dAtA[i:], m.Stamp) 658 i = encodeVarintPullsync(dAtA, i, uint64(len(m.Stamp))) 659 i-- 660 dAtA[i] = 0x1a 661 } 662 if len(m.Data) > 0 { 663 i -= len(m.Data) 664 copy(dAtA[i:], m.Data) 665 i = encodeVarintPullsync(dAtA, i, uint64(len(m.Data))) 666 i-- 667 dAtA[i] = 0x12 668 } 669 if len(m.Address) > 0 { 670 i -= len(m.Address) 671 copy(dAtA[i:], m.Address) 672 i = encodeVarintPullsync(dAtA, i, uint64(len(m.Address))) 673 i-- 674 dAtA[i] = 0xa 675 } 676 return len(dAtA) - i, nil 677 } 678 679 func encodeVarintPullsync(dAtA []byte, offset int, v uint64) int { 680 offset -= sovPullsync(v) 681 base := offset 682 for v >= 1<<7 { 683 dAtA[offset] = uint8(v&0x7f | 0x80) 684 v >>= 7 685 offset++ 686 } 687 dAtA[offset] = uint8(v) 688 return base 689 } 690 func (m *Syn) Size() (n int) { 691 if m == nil { 692 return 0 693 } 694 var l int 695 _ = l 696 return n 697 } 698 699 func (m *Ack) Size() (n int) { 700 if m == nil { 701 return 0 702 } 703 var l int 704 _ = l 705 if len(m.Cursors) > 0 { 706 l = 0 707 for _, e := range m.Cursors { 708 l += sovPullsync(uint64(e)) 709 } 710 n += 1 + sovPullsync(uint64(l)) + l 711 } 712 if m.Epoch != 0 { 713 n += 1 + sovPullsync(uint64(m.Epoch)) 714 } 715 return n 716 } 717 718 func (m *Get) Size() (n int) { 719 if m == nil { 720 return 0 721 } 722 var l int 723 _ = l 724 if m.Bin != 0 { 725 n += 1 + sovPullsync(uint64(m.Bin)) 726 } 727 if m.Start != 0 { 728 n += 1 + sovPullsync(uint64(m.Start)) 729 } 730 return n 731 } 732 733 func (m *Chunk) Size() (n int) { 734 if m == nil { 735 return 0 736 } 737 var l int 738 _ = l 739 l = len(m.Address) 740 if l > 0 { 741 n += 1 + l + sovPullsync(uint64(l)) 742 } 743 l = len(m.BatchID) 744 if l > 0 { 745 n += 1 + l + sovPullsync(uint64(l)) 746 } 747 l = len(m.StampHash) 748 if l > 0 { 749 n += 1 + l + sovPullsync(uint64(l)) 750 } 751 return n 752 } 753 754 func (m *Offer) Size() (n int) { 755 if m == nil { 756 return 0 757 } 758 var l int 759 _ = l 760 if m.Topmost != 0 { 761 n += 1 + sovPullsync(uint64(m.Topmost)) 762 } 763 if len(m.Chunks) > 0 { 764 for _, e := range m.Chunks { 765 l = e.Size() 766 n += 1 + l + sovPullsync(uint64(l)) 767 } 768 } 769 return n 770 } 771 772 func (m *Want) Size() (n int) { 773 if m == nil { 774 return 0 775 } 776 var l int 777 _ = l 778 l = len(m.BitVector) 779 if l > 0 { 780 n += 1 + l + sovPullsync(uint64(l)) 781 } 782 return n 783 } 784 785 func (m *Delivery) Size() (n int) { 786 if m == nil { 787 return 0 788 } 789 var l int 790 _ = l 791 l = len(m.Address) 792 if l > 0 { 793 n += 1 + l + sovPullsync(uint64(l)) 794 } 795 l = len(m.Data) 796 if l > 0 { 797 n += 1 + l + sovPullsync(uint64(l)) 798 } 799 l = len(m.Stamp) 800 if l > 0 { 801 n += 1 + l + sovPullsync(uint64(l)) 802 } 803 return n 804 } 805 806 func sovPullsync(x uint64) (n int) { 807 return (math_bits.Len64(x|1) + 6) / 7 808 } 809 func sozPullsync(x uint64) (n int) { 810 return sovPullsync(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 811 } 812 func (m *Syn) Unmarshal(dAtA []byte) error { 813 l := len(dAtA) 814 iNdEx := 0 815 for iNdEx < l { 816 preIndex := iNdEx 817 var wire uint64 818 for shift := uint(0); ; shift += 7 { 819 if shift >= 64 { 820 return ErrIntOverflowPullsync 821 } 822 if iNdEx >= l { 823 return io.ErrUnexpectedEOF 824 } 825 b := dAtA[iNdEx] 826 iNdEx++ 827 wire |= uint64(b&0x7F) << shift 828 if b < 0x80 { 829 break 830 } 831 } 832 fieldNum := int32(wire >> 3) 833 wireType := int(wire & 0x7) 834 if wireType == 4 { 835 return fmt.Errorf("proto: Syn: wiretype end group for non-group") 836 } 837 if fieldNum <= 0 { 838 return fmt.Errorf("proto: Syn: illegal tag %d (wire type %d)", fieldNum, wire) 839 } 840 switch fieldNum { 841 default: 842 iNdEx = preIndex 843 skippy, err := skipPullsync(dAtA[iNdEx:]) 844 if err != nil { 845 return err 846 } 847 if skippy < 0 { 848 return ErrInvalidLengthPullsync 849 } 850 if (iNdEx + skippy) < 0 { 851 return ErrInvalidLengthPullsync 852 } 853 if (iNdEx + skippy) > l { 854 return io.ErrUnexpectedEOF 855 } 856 iNdEx += skippy 857 } 858 } 859 860 if iNdEx > l { 861 return io.ErrUnexpectedEOF 862 } 863 return nil 864 } 865 func (m *Ack) Unmarshal(dAtA []byte) error { 866 l := len(dAtA) 867 iNdEx := 0 868 for iNdEx < l { 869 preIndex := iNdEx 870 var wire uint64 871 for shift := uint(0); ; shift += 7 { 872 if shift >= 64 { 873 return ErrIntOverflowPullsync 874 } 875 if iNdEx >= l { 876 return io.ErrUnexpectedEOF 877 } 878 b := dAtA[iNdEx] 879 iNdEx++ 880 wire |= uint64(b&0x7F) << shift 881 if b < 0x80 { 882 break 883 } 884 } 885 fieldNum := int32(wire >> 3) 886 wireType := int(wire & 0x7) 887 if wireType == 4 { 888 return fmt.Errorf("proto: Ack: wiretype end group for non-group") 889 } 890 if fieldNum <= 0 { 891 return fmt.Errorf("proto: Ack: illegal tag %d (wire type %d)", fieldNum, wire) 892 } 893 switch fieldNum { 894 case 1: 895 if wireType == 0 { 896 var v uint64 897 for shift := uint(0); ; shift += 7 { 898 if shift >= 64 { 899 return ErrIntOverflowPullsync 900 } 901 if iNdEx >= l { 902 return io.ErrUnexpectedEOF 903 } 904 b := dAtA[iNdEx] 905 iNdEx++ 906 v |= uint64(b&0x7F) << shift 907 if b < 0x80 { 908 break 909 } 910 } 911 m.Cursors = append(m.Cursors, v) 912 } else if wireType == 2 { 913 var packedLen int 914 for shift := uint(0); ; shift += 7 { 915 if shift >= 64 { 916 return ErrIntOverflowPullsync 917 } 918 if iNdEx >= l { 919 return io.ErrUnexpectedEOF 920 } 921 b := dAtA[iNdEx] 922 iNdEx++ 923 packedLen |= int(b&0x7F) << shift 924 if b < 0x80 { 925 break 926 } 927 } 928 if packedLen < 0 { 929 return ErrInvalidLengthPullsync 930 } 931 postIndex := iNdEx + packedLen 932 if postIndex < 0 { 933 return ErrInvalidLengthPullsync 934 } 935 if postIndex > l { 936 return io.ErrUnexpectedEOF 937 } 938 var elementCount int 939 var count int 940 for _, integer := range dAtA[iNdEx:postIndex] { 941 if integer < 128 { 942 count++ 943 } 944 } 945 elementCount = count 946 if elementCount != 0 && len(m.Cursors) == 0 { 947 m.Cursors = make([]uint64, 0, elementCount) 948 } 949 for iNdEx < postIndex { 950 var v uint64 951 for shift := uint(0); ; shift += 7 { 952 if shift >= 64 { 953 return ErrIntOverflowPullsync 954 } 955 if iNdEx >= l { 956 return io.ErrUnexpectedEOF 957 } 958 b := dAtA[iNdEx] 959 iNdEx++ 960 v |= uint64(b&0x7F) << shift 961 if b < 0x80 { 962 break 963 } 964 } 965 m.Cursors = append(m.Cursors, v) 966 } 967 } else { 968 return fmt.Errorf("proto: wrong wireType = %d for field Cursors", wireType) 969 } 970 case 2: 971 if wireType != 0 { 972 return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) 973 } 974 m.Epoch = 0 975 for shift := uint(0); ; shift += 7 { 976 if shift >= 64 { 977 return ErrIntOverflowPullsync 978 } 979 if iNdEx >= l { 980 return io.ErrUnexpectedEOF 981 } 982 b := dAtA[iNdEx] 983 iNdEx++ 984 m.Epoch |= uint64(b&0x7F) << shift 985 if b < 0x80 { 986 break 987 } 988 } 989 default: 990 iNdEx = preIndex 991 skippy, err := skipPullsync(dAtA[iNdEx:]) 992 if err != nil { 993 return err 994 } 995 if skippy < 0 { 996 return ErrInvalidLengthPullsync 997 } 998 if (iNdEx + skippy) < 0 { 999 return ErrInvalidLengthPullsync 1000 } 1001 if (iNdEx + skippy) > l { 1002 return io.ErrUnexpectedEOF 1003 } 1004 iNdEx += skippy 1005 } 1006 } 1007 1008 if iNdEx > l { 1009 return io.ErrUnexpectedEOF 1010 } 1011 return nil 1012 } 1013 func (m *Get) Unmarshal(dAtA []byte) error { 1014 l := len(dAtA) 1015 iNdEx := 0 1016 for iNdEx < l { 1017 preIndex := iNdEx 1018 var wire uint64 1019 for shift := uint(0); ; shift += 7 { 1020 if shift >= 64 { 1021 return ErrIntOverflowPullsync 1022 } 1023 if iNdEx >= l { 1024 return io.ErrUnexpectedEOF 1025 } 1026 b := dAtA[iNdEx] 1027 iNdEx++ 1028 wire |= uint64(b&0x7F) << shift 1029 if b < 0x80 { 1030 break 1031 } 1032 } 1033 fieldNum := int32(wire >> 3) 1034 wireType := int(wire & 0x7) 1035 if wireType == 4 { 1036 return fmt.Errorf("proto: Get: wiretype end group for non-group") 1037 } 1038 if fieldNum <= 0 { 1039 return fmt.Errorf("proto: Get: illegal tag %d (wire type %d)", fieldNum, wire) 1040 } 1041 switch fieldNum { 1042 case 1: 1043 if wireType != 0 { 1044 return fmt.Errorf("proto: wrong wireType = %d for field Bin", wireType) 1045 } 1046 m.Bin = 0 1047 for shift := uint(0); ; shift += 7 { 1048 if shift >= 64 { 1049 return ErrIntOverflowPullsync 1050 } 1051 if iNdEx >= l { 1052 return io.ErrUnexpectedEOF 1053 } 1054 b := dAtA[iNdEx] 1055 iNdEx++ 1056 m.Bin |= int32(b&0x7F) << shift 1057 if b < 0x80 { 1058 break 1059 } 1060 } 1061 case 2: 1062 if wireType != 0 { 1063 return fmt.Errorf("proto: wrong wireType = %d for field Start", wireType) 1064 } 1065 m.Start = 0 1066 for shift := uint(0); ; shift += 7 { 1067 if shift >= 64 { 1068 return ErrIntOverflowPullsync 1069 } 1070 if iNdEx >= l { 1071 return io.ErrUnexpectedEOF 1072 } 1073 b := dAtA[iNdEx] 1074 iNdEx++ 1075 m.Start |= uint64(b&0x7F) << shift 1076 if b < 0x80 { 1077 break 1078 } 1079 } 1080 default: 1081 iNdEx = preIndex 1082 skippy, err := skipPullsync(dAtA[iNdEx:]) 1083 if err != nil { 1084 return err 1085 } 1086 if skippy < 0 { 1087 return ErrInvalidLengthPullsync 1088 } 1089 if (iNdEx + skippy) < 0 { 1090 return ErrInvalidLengthPullsync 1091 } 1092 if (iNdEx + skippy) > l { 1093 return io.ErrUnexpectedEOF 1094 } 1095 iNdEx += skippy 1096 } 1097 } 1098 1099 if iNdEx > l { 1100 return io.ErrUnexpectedEOF 1101 } 1102 return nil 1103 } 1104 func (m *Chunk) Unmarshal(dAtA []byte) error { 1105 l := len(dAtA) 1106 iNdEx := 0 1107 for iNdEx < l { 1108 preIndex := iNdEx 1109 var wire uint64 1110 for shift := uint(0); ; shift += 7 { 1111 if shift >= 64 { 1112 return ErrIntOverflowPullsync 1113 } 1114 if iNdEx >= l { 1115 return io.ErrUnexpectedEOF 1116 } 1117 b := dAtA[iNdEx] 1118 iNdEx++ 1119 wire |= uint64(b&0x7F) << shift 1120 if b < 0x80 { 1121 break 1122 } 1123 } 1124 fieldNum := int32(wire >> 3) 1125 wireType := int(wire & 0x7) 1126 if wireType == 4 { 1127 return fmt.Errorf("proto: Chunk: wiretype end group for non-group") 1128 } 1129 if fieldNum <= 0 { 1130 return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) 1131 } 1132 switch fieldNum { 1133 case 1: 1134 if wireType != 2 { 1135 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 1136 } 1137 var byteLen int 1138 for shift := uint(0); ; shift += 7 { 1139 if shift >= 64 { 1140 return ErrIntOverflowPullsync 1141 } 1142 if iNdEx >= l { 1143 return io.ErrUnexpectedEOF 1144 } 1145 b := dAtA[iNdEx] 1146 iNdEx++ 1147 byteLen |= int(b&0x7F) << shift 1148 if b < 0x80 { 1149 break 1150 } 1151 } 1152 if byteLen < 0 { 1153 return ErrInvalidLengthPullsync 1154 } 1155 postIndex := iNdEx + byteLen 1156 if postIndex < 0 { 1157 return ErrInvalidLengthPullsync 1158 } 1159 if postIndex > l { 1160 return io.ErrUnexpectedEOF 1161 } 1162 m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) 1163 if m.Address == nil { 1164 m.Address = []byte{} 1165 } 1166 iNdEx = postIndex 1167 case 2: 1168 if wireType != 2 { 1169 return fmt.Errorf("proto: wrong wireType = %d for field BatchID", wireType) 1170 } 1171 var byteLen int 1172 for shift := uint(0); ; shift += 7 { 1173 if shift >= 64 { 1174 return ErrIntOverflowPullsync 1175 } 1176 if iNdEx >= l { 1177 return io.ErrUnexpectedEOF 1178 } 1179 b := dAtA[iNdEx] 1180 iNdEx++ 1181 byteLen |= int(b&0x7F) << shift 1182 if b < 0x80 { 1183 break 1184 } 1185 } 1186 if byteLen < 0 { 1187 return ErrInvalidLengthPullsync 1188 } 1189 postIndex := iNdEx + byteLen 1190 if postIndex < 0 { 1191 return ErrInvalidLengthPullsync 1192 } 1193 if postIndex > l { 1194 return io.ErrUnexpectedEOF 1195 } 1196 m.BatchID = append(m.BatchID[:0], dAtA[iNdEx:postIndex]...) 1197 if m.BatchID == nil { 1198 m.BatchID = []byte{} 1199 } 1200 iNdEx = postIndex 1201 case 3: 1202 if wireType != 2 { 1203 return fmt.Errorf("proto: wrong wireType = %d for field StampHash", wireType) 1204 } 1205 var byteLen int 1206 for shift := uint(0); ; shift += 7 { 1207 if shift >= 64 { 1208 return ErrIntOverflowPullsync 1209 } 1210 if iNdEx >= l { 1211 return io.ErrUnexpectedEOF 1212 } 1213 b := dAtA[iNdEx] 1214 iNdEx++ 1215 byteLen |= int(b&0x7F) << shift 1216 if b < 0x80 { 1217 break 1218 } 1219 } 1220 if byteLen < 0 { 1221 return ErrInvalidLengthPullsync 1222 } 1223 postIndex := iNdEx + byteLen 1224 if postIndex < 0 { 1225 return ErrInvalidLengthPullsync 1226 } 1227 if postIndex > l { 1228 return io.ErrUnexpectedEOF 1229 } 1230 m.StampHash = append(m.StampHash[:0], dAtA[iNdEx:postIndex]...) 1231 if m.StampHash == nil { 1232 m.StampHash = []byte{} 1233 } 1234 iNdEx = postIndex 1235 default: 1236 iNdEx = preIndex 1237 skippy, err := skipPullsync(dAtA[iNdEx:]) 1238 if err != nil { 1239 return err 1240 } 1241 if skippy < 0 { 1242 return ErrInvalidLengthPullsync 1243 } 1244 if (iNdEx + skippy) < 0 { 1245 return ErrInvalidLengthPullsync 1246 } 1247 if (iNdEx + skippy) > l { 1248 return io.ErrUnexpectedEOF 1249 } 1250 iNdEx += skippy 1251 } 1252 } 1253 1254 if iNdEx > l { 1255 return io.ErrUnexpectedEOF 1256 } 1257 return nil 1258 } 1259 func (m *Offer) Unmarshal(dAtA []byte) error { 1260 l := len(dAtA) 1261 iNdEx := 0 1262 for iNdEx < l { 1263 preIndex := iNdEx 1264 var wire uint64 1265 for shift := uint(0); ; shift += 7 { 1266 if shift >= 64 { 1267 return ErrIntOverflowPullsync 1268 } 1269 if iNdEx >= l { 1270 return io.ErrUnexpectedEOF 1271 } 1272 b := dAtA[iNdEx] 1273 iNdEx++ 1274 wire |= uint64(b&0x7F) << shift 1275 if b < 0x80 { 1276 break 1277 } 1278 } 1279 fieldNum := int32(wire >> 3) 1280 wireType := int(wire & 0x7) 1281 if wireType == 4 { 1282 return fmt.Errorf("proto: Offer: wiretype end group for non-group") 1283 } 1284 if fieldNum <= 0 { 1285 return fmt.Errorf("proto: Offer: illegal tag %d (wire type %d)", fieldNum, wire) 1286 } 1287 switch fieldNum { 1288 case 1: 1289 if wireType != 0 { 1290 return fmt.Errorf("proto: wrong wireType = %d for field Topmost", wireType) 1291 } 1292 m.Topmost = 0 1293 for shift := uint(0); ; shift += 7 { 1294 if shift >= 64 { 1295 return ErrIntOverflowPullsync 1296 } 1297 if iNdEx >= l { 1298 return io.ErrUnexpectedEOF 1299 } 1300 b := dAtA[iNdEx] 1301 iNdEx++ 1302 m.Topmost |= uint64(b&0x7F) << shift 1303 if b < 0x80 { 1304 break 1305 } 1306 } 1307 case 2: 1308 if wireType != 2 { 1309 return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) 1310 } 1311 var msglen int 1312 for shift := uint(0); ; shift += 7 { 1313 if shift >= 64 { 1314 return ErrIntOverflowPullsync 1315 } 1316 if iNdEx >= l { 1317 return io.ErrUnexpectedEOF 1318 } 1319 b := dAtA[iNdEx] 1320 iNdEx++ 1321 msglen |= int(b&0x7F) << shift 1322 if b < 0x80 { 1323 break 1324 } 1325 } 1326 if msglen < 0 { 1327 return ErrInvalidLengthPullsync 1328 } 1329 postIndex := iNdEx + msglen 1330 if postIndex < 0 { 1331 return ErrInvalidLengthPullsync 1332 } 1333 if postIndex > l { 1334 return io.ErrUnexpectedEOF 1335 } 1336 m.Chunks = append(m.Chunks, &Chunk{}) 1337 if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1338 return err 1339 } 1340 iNdEx = postIndex 1341 default: 1342 iNdEx = preIndex 1343 skippy, err := skipPullsync(dAtA[iNdEx:]) 1344 if err != nil { 1345 return err 1346 } 1347 if skippy < 0 { 1348 return ErrInvalidLengthPullsync 1349 } 1350 if (iNdEx + skippy) < 0 { 1351 return ErrInvalidLengthPullsync 1352 } 1353 if (iNdEx + skippy) > l { 1354 return io.ErrUnexpectedEOF 1355 } 1356 iNdEx += skippy 1357 } 1358 } 1359 1360 if iNdEx > l { 1361 return io.ErrUnexpectedEOF 1362 } 1363 return nil 1364 } 1365 func (m *Want) Unmarshal(dAtA []byte) error { 1366 l := len(dAtA) 1367 iNdEx := 0 1368 for iNdEx < l { 1369 preIndex := iNdEx 1370 var wire uint64 1371 for shift := uint(0); ; shift += 7 { 1372 if shift >= 64 { 1373 return ErrIntOverflowPullsync 1374 } 1375 if iNdEx >= l { 1376 return io.ErrUnexpectedEOF 1377 } 1378 b := dAtA[iNdEx] 1379 iNdEx++ 1380 wire |= uint64(b&0x7F) << shift 1381 if b < 0x80 { 1382 break 1383 } 1384 } 1385 fieldNum := int32(wire >> 3) 1386 wireType := int(wire & 0x7) 1387 if wireType == 4 { 1388 return fmt.Errorf("proto: Want: wiretype end group for non-group") 1389 } 1390 if fieldNum <= 0 { 1391 return fmt.Errorf("proto: Want: illegal tag %d (wire type %d)", fieldNum, wire) 1392 } 1393 switch fieldNum { 1394 case 1: 1395 if wireType != 2 { 1396 return fmt.Errorf("proto: wrong wireType = %d for field BitVector", wireType) 1397 } 1398 var byteLen int 1399 for shift := uint(0); ; shift += 7 { 1400 if shift >= 64 { 1401 return ErrIntOverflowPullsync 1402 } 1403 if iNdEx >= l { 1404 return io.ErrUnexpectedEOF 1405 } 1406 b := dAtA[iNdEx] 1407 iNdEx++ 1408 byteLen |= int(b&0x7F) << shift 1409 if b < 0x80 { 1410 break 1411 } 1412 } 1413 if byteLen < 0 { 1414 return ErrInvalidLengthPullsync 1415 } 1416 postIndex := iNdEx + byteLen 1417 if postIndex < 0 { 1418 return ErrInvalidLengthPullsync 1419 } 1420 if postIndex > l { 1421 return io.ErrUnexpectedEOF 1422 } 1423 m.BitVector = append(m.BitVector[:0], dAtA[iNdEx:postIndex]...) 1424 if m.BitVector == nil { 1425 m.BitVector = []byte{} 1426 } 1427 iNdEx = postIndex 1428 default: 1429 iNdEx = preIndex 1430 skippy, err := skipPullsync(dAtA[iNdEx:]) 1431 if err != nil { 1432 return err 1433 } 1434 if skippy < 0 { 1435 return ErrInvalidLengthPullsync 1436 } 1437 if (iNdEx + skippy) < 0 { 1438 return ErrInvalidLengthPullsync 1439 } 1440 if (iNdEx + skippy) > l { 1441 return io.ErrUnexpectedEOF 1442 } 1443 iNdEx += skippy 1444 } 1445 } 1446 1447 if iNdEx > l { 1448 return io.ErrUnexpectedEOF 1449 } 1450 return nil 1451 } 1452 func (m *Delivery) Unmarshal(dAtA []byte) error { 1453 l := len(dAtA) 1454 iNdEx := 0 1455 for iNdEx < l { 1456 preIndex := iNdEx 1457 var wire uint64 1458 for shift := uint(0); ; shift += 7 { 1459 if shift >= 64 { 1460 return ErrIntOverflowPullsync 1461 } 1462 if iNdEx >= l { 1463 return io.ErrUnexpectedEOF 1464 } 1465 b := dAtA[iNdEx] 1466 iNdEx++ 1467 wire |= uint64(b&0x7F) << shift 1468 if b < 0x80 { 1469 break 1470 } 1471 } 1472 fieldNum := int32(wire >> 3) 1473 wireType := int(wire & 0x7) 1474 if wireType == 4 { 1475 return fmt.Errorf("proto: Delivery: wiretype end group for non-group") 1476 } 1477 if fieldNum <= 0 { 1478 return fmt.Errorf("proto: Delivery: illegal tag %d (wire type %d)", fieldNum, wire) 1479 } 1480 switch fieldNum { 1481 case 1: 1482 if wireType != 2 { 1483 return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) 1484 } 1485 var byteLen int 1486 for shift := uint(0); ; shift += 7 { 1487 if shift >= 64 { 1488 return ErrIntOverflowPullsync 1489 } 1490 if iNdEx >= l { 1491 return io.ErrUnexpectedEOF 1492 } 1493 b := dAtA[iNdEx] 1494 iNdEx++ 1495 byteLen |= int(b&0x7F) << shift 1496 if b < 0x80 { 1497 break 1498 } 1499 } 1500 if byteLen < 0 { 1501 return ErrInvalidLengthPullsync 1502 } 1503 postIndex := iNdEx + byteLen 1504 if postIndex < 0 { 1505 return ErrInvalidLengthPullsync 1506 } 1507 if postIndex > l { 1508 return io.ErrUnexpectedEOF 1509 } 1510 m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) 1511 if m.Address == nil { 1512 m.Address = []byte{} 1513 } 1514 iNdEx = postIndex 1515 case 2: 1516 if wireType != 2 { 1517 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) 1518 } 1519 var byteLen int 1520 for shift := uint(0); ; shift += 7 { 1521 if shift >= 64 { 1522 return ErrIntOverflowPullsync 1523 } 1524 if iNdEx >= l { 1525 return io.ErrUnexpectedEOF 1526 } 1527 b := dAtA[iNdEx] 1528 iNdEx++ 1529 byteLen |= int(b&0x7F) << shift 1530 if b < 0x80 { 1531 break 1532 } 1533 } 1534 if byteLen < 0 { 1535 return ErrInvalidLengthPullsync 1536 } 1537 postIndex := iNdEx + byteLen 1538 if postIndex < 0 { 1539 return ErrInvalidLengthPullsync 1540 } 1541 if postIndex > l { 1542 return io.ErrUnexpectedEOF 1543 } 1544 m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) 1545 if m.Data == nil { 1546 m.Data = []byte{} 1547 } 1548 iNdEx = postIndex 1549 case 3: 1550 if wireType != 2 { 1551 return fmt.Errorf("proto: wrong wireType = %d for field Stamp", wireType) 1552 } 1553 var byteLen int 1554 for shift := uint(0); ; shift += 7 { 1555 if shift >= 64 { 1556 return ErrIntOverflowPullsync 1557 } 1558 if iNdEx >= l { 1559 return io.ErrUnexpectedEOF 1560 } 1561 b := dAtA[iNdEx] 1562 iNdEx++ 1563 byteLen |= int(b&0x7F) << shift 1564 if b < 0x80 { 1565 break 1566 } 1567 } 1568 if byteLen < 0 { 1569 return ErrInvalidLengthPullsync 1570 } 1571 postIndex := iNdEx + byteLen 1572 if postIndex < 0 { 1573 return ErrInvalidLengthPullsync 1574 } 1575 if postIndex > l { 1576 return io.ErrUnexpectedEOF 1577 } 1578 m.Stamp = append(m.Stamp[:0], dAtA[iNdEx:postIndex]...) 1579 if m.Stamp == nil { 1580 m.Stamp = []byte{} 1581 } 1582 iNdEx = postIndex 1583 default: 1584 iNdEx = preIndex 1585 skippy, err := skipPullsync(dAtA[iNdEx:]) 1586 if err != nil { 1587 return err 1588 } 1589 if skippy < 0 { 1590 return ErrInvalidLengthPullsync 1591 } 1592 if (iNdEx + skippy) < 0 { 1593 return ErrInvalidLengthPullsync 1594 } 1595 if (iNdEx + skippy) > l { 1596 return io.ErrUnexpectedEOF 1597 } 1598 iNdEx += skippy 1599 } 1600 } 1601 1602 if iNdEx > l { 1603 return io.ErrUnexpectedEOF 1604 } 1605 return nil 1606 } 1607 func skipPullsync(dAtA []byte) (n int, err error) { 1608 l := len(dAtA) 1609 iNdEx := 0 1610 depth := 0 1611 for iNdEx < l { 1612 var wire uint64 1613 for shift := uint(0); ; shift += 7 { 1614 if shift >= 64 { 1615 return 0, ErrIntOverflowPullsync 1616 } 1617 if iNdEx >= l { 1618 return 0, io.ErrUnexpectedEOF 1619 } 1620 b := dAtA[iNdEx] 1621 iNdEx++ 1622 wire |= (uint64(b) & 0x7F) << shift 1623 if b < 0x80 { 1624 break 1625 } 1626 } 1627 wireType := int(wire & 0x7) 1628 switch wireType { 1629 case 0: 1630 for shift := uint(0); ; shift += 7 { 1631 if shift >= 64 { 1632 return 0, ErrIntOverflowPullsync 1633 } 1634 if iNdEx >= l { 1635 return 0, io.ErrUnexpectedEOF 1636 } 1637 iNdEx++ 1638 if dAtA[iNdEx-1] < 0x80 { 1639 break 1640 } 1641 } 1642 case 1: 1643 iNdEx += 8 1644 case 2: 1645 var length int 1646 for shift := uint(0); ; shift += 7 { 1647 if shift >= 64 { 1648 return 0, ErrIntOverflowPullsync 1649 } 1650 if iNdEx >= l { 1651 return 0, io.ErrUnexpectedEOF 1652 } 1653 b := dAtA[iNdEx] 1654 iNdEx++ 1655 length |= (int(b) & 0x7F) << shift 1656 if b < 0x80 { 1657 break 1658 } 1659 } 1660 if length < 0 { 1661 return 0, ErrInvalidLengthPullsync 1662 } 1663 iNdEx += length 1664 case 3: 1665 depth++ 1666 case 4: 1667 if depth == 0 { 1668 return 0, ErrUnexpectedEndOfGroupPullsync 1669 } 1670 depth-- 1671 case 5: 1672 iNdEx += 4 1673 default: 1674 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1675 } 1676 if iNdEx < 0 { 1677 return 0, ErrInvalidLengthPullsync 1678 } 1679 if depth == 0 { 1680 return iNdEx, nil 1681 } 1682 } 1683 return 0, io.ErrUnexpectedEOF 1684 } 1685 1686 var ( 1687 ErrInvalidLengthPullsync = fmt.Errorf("proto: negative length found during unmarshaling") 1688 ErrIntOverflowPullsync = fmt.Errorf("proto: integer overflow") 1689 ErrUnexpectedEndOfGroupPullsync = fmt.Errorf("proto: unexpected end of group") 1690 )