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