You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1643 lines
38 KiB

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