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