record.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: record.proto
  3. package walpb
  4. import (
  5. fmt "fmt"
  6. io "io"
  7. math "math"
  8. math_bits "math/bits"
  9. _ "github.com/gogo/protobuf/gogoproto"
  10. proto "github.com/golang/protobuf/proto"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  21. type Record struct {
  22. Type int64 `protobuf:"varint,1,opt,name=type" json:"type"`
  23. Crc uint32 `protobuf:"varint,2,opt,name=crc" json:"crc"`
  24. Data []byte `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
  25. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  26. XXX_unrecognized []byte `json:"-"`
  27. XXX_sizecache int32 `json:"-"`
  28. }
  29. func (m *Record) Reset() { *m = Record{} }
  30. func (m *Record) String() string { return proto.CompactTextString(m) }
  31. func (*Record) ProtoMessage() {}
  32. func (*Record) Descriptor() ([]byte, []int) {
  33. return fileDescriptor_bf94fd919e302a1d, []int{0}
  34. }
  35. func (m *Record) XXX_Unmarshal(b []byte) error {
  36. return m.Unmarshal(b)
  37. }
  38. func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  39. if deterministic {
  40. return xxx_messageInfo_Record.Marshal(b, m, deterministic)
  41. } else {
  42. b = b[:cap(b)]
  43. n, err := m.MarshalToSizedBuffer(b)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return b[:n], nil
  48. }
  49. }
  50. func (m *Record) XXX_Merge(src proto.Message) {
  51. xxx_messageInfo_Record.Merge(m, src)
  52. }
  53. func (m *Record) XXX_Size() int {
  54. return m.Size()
  55. }
  56. func (m *Record) XXX_DiscardUnknown() {
  57. xxx_messageInfo_Record.DiscardUnknown(m)
  58. }
  59. var xxx_messageInfo_Record proto.InternalMessageInfo
  60. type Snapshot struct {
  61. Index uint64 `protobuf:"varint,1,opt,name=index" json:"index"`
  62. Term uint64 `protobuf:"varint,2,opt,name=term" json:"term"`
  63. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  64. XXX_unrecognized []byte `json:"-"`
  65. XXX_sizecache int32 `json:"-"`
  66. }
  67. func (m *Snapshot) Reset() { *m = Snapshot{} }
  68. func (m *Snapshot) String() string { return proto.CompactTextString(m) }
  69. func (*Snapshot) ProtoMessage() {}
  70. func (*Snapshot) Descriptor() ([]byte, []int) {
  71. return fileDescriptor_bf94fd919e302a1d, []int{1}
  72. }
  73. func (m *Snapshot) XXX_Unmarshal(b []byte) error {
  74. return m.Unmarshal(b)
  75. }
  76. func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  77. if deterministic {
  78. return xxx_messageInfo_Snapshot.Marshal(b, m, deterministic)
  79. } else {
  80. b = b[:cap(b)]
  81. n, err := m.MarshalToSizedBuffer(b)
  82. if err != nil {
  83. return nil, err
  84. }
  85. return b[:n], nil
  86. }
  87. }
  88. func (m *Snapshot) XXX_Merge(src proto.Message) {
  89. xxx_messageInfo_Snapshot.Merge(m, src)
  90. }
  91. func (m *Snapshot) XXX_Size() int {
  92. return m.Size()
  93. }
  94. func (m *Snapshot) XXX_DiscardUnknown() {
  95. xxx_messageInfo_Snapshot.DiscardUnknown(m)
  96. }
  97. var xxx_messageInfo_Snapshot proto.InternalMessageInfo
  98. func init() {
  99. proto.RegisterType((*Record)(nil), "walpb.Record")
  100. proto.RegisterType((*Snapshot)(nil), "walpb.Snapshot")
  101. }
  102. func init() { proto.RegisterFile("record.proto", fileDescriptor_bf94fd919e302a1d) }
  103. var fileDescriptor_bf94fd919e302a1d = []byte{
  104. // 186 bytes of a gzipped FileDescriptorProto
  105. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4a, 0x4d, 0xce,
  106. 0x2f, 0x4a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0x4f, 0xcc, 0x29, 0x48, 0x92,
  107. 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe8, 0x83, 0x58, 0x10, 0x49, 0x25, 0x3f, 0x2e, 0xb6,
  108. 0x20, 0xb0, 0x62, 0x21, 0x09, 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d,
  109. 0x66, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xc0, 0x22, 0x42, 0x62, 0x5c, 0xcc, 0xc9, 0x45,
  110. 0xc9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xbc, 0x50, 0x09, 0x90, 0x80, 0x90, 0x10, 0x17, 0x4b, 0x4a,
  111. 0x62, 0x49, 0xa2, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x98, 0xad, 0xe4, 0xc0, 0xc5, 0x11,
  112. 0x9c, 0x97, 0x58, 0x50, 0x9c, 0x91, 0x5f, 0x22, 0x24, 0xc5, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a,
  113. 0x01, 0x36, 0x92, 0x05, 0xaa, 0x13, 0x22, 0x04, 0xb6, 0x2d, 0xb5, 0x28, 0x17, 0x6c, 0x28, 0x0b,
  114. 0xdc, 0xb6, 0xd4, 0xa2, 0x5c, 0x27, 0x91, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc,
  115. 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19, 0x8f, 0xe5, 0x18, 0x00, 0x01, 0x00, 0x00,
  116. 0xff, 0xff, 0x7f, 0x5e, 0x5c, 0x46, 0xd3, 0x00, 0x00, 0x00,
  117. }
  118. func (m *Record) Marshal() (dAtA []byte, err error) {
  119. size := m.Size()
  120. dAtA = make([]byte, size)
  121. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  122. if err != nil {
  123. return nil, err
  124. }
  125. return dAtA[:n], nil
  126. }
  127. func (m *Record) MarshalTo(dAtA []byte) (int, error) {
  128. size := m.Size()
  129. return m.MarshalToSizedBuffer(dAtA[:size])
  130. }
  131. func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  132. i := len(dAtA)
  133. _ = i
  134. var l int
  135. _ = l
  136. if m.XXX_unrecognized != nil {
  137. i -= len(m.XXX_unrecognized)
  138. copy(dAtA[i:], m.XXX_unrecognized)
  139. }
  140. if m.Data != nil {
  141. i -= len(m.Data)
  142. copy(dAtA[i:], m.Data)
  143. i = encodeVarintRecord(dAtA, i, uint64(len(m.Data)))
  144. i--
  145. dAtA[i] = 0x1a
  146. }
  147. i = encodeVarintRecord(dAtA, i, uint64(m.Crc))
  148. i--
  149. dAtA[i] = 0x10
  150. i = encodeVarintRecord(dAtA, i, uint64(m.Type))
  151. i--
  152. dAtA[i] = 0x8
  153. return len(dAtA) - i, nil
  154. }
  155. func (m *Snapshot) Marshal() (dAtA []byte, err error) {
  156. size := m.Size()
  157. dAtA = make([]byte, size)
  158. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  159. if err != nil {
  160. return nil, err
  161. }
  162. return dAtA[:n], nil
  163. }
  164. func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
  165. size := m.Size()
  166. return m.MarshalToSizedBuffer(dAtA[:size])
  167. }
  168. func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  169. i := len(dAtA)
  170. _ = i
  171. var l int
  172. _ = l
  173. if m.XXX_unrecognized != nil {
  174. i -= len(m.XXX_unrecognized)
  175. copy(dAtA[i:], m.XXX_unrecognized)
  176. }
  177. i = encodeVarintRecord(dAtA, i, uint64(m.Term))
  178. i--
  179. dAtA[i] = 0x10
  180. i = encodeVarintRecord(dAtA, i, uint64(m.Index))
  181. i--
  182. dAtA[i] = 0x8
  183. return len(dAtA) - i, nil
  184. }
  185. func encodeVarintRecord(dAtA []byte, offset int, v uint64) int {
  186. offset -= sovRecord(v)
  187. base := offset
  188. for v >= 1<<7 {
  189. dAtA[offset] = uint8(v&0x7f | 0x80)
  190. v >>= 7
  191. offset++
  192. }
  193. dAtA[offset] = uint8(v)
  194. return base
  195. }
  196. func (m *Record) Size() (n int) {
  197. if m == nil {
  198. return 0
  199. }
  200. var l int
  201. _ = l
  202. n += 1 + sovRecord(uint64(m.Type))
  203. n += 1 + sovRecord(uint64(m.Crc))
  204. if m.Data != nil {
  205. l = len(m.Data)
  206. n += 1 + l + sovRecord(uint64(l))
  207. }
  208. if m.XXX_unrecognized != nil {
  209. n += len(m.XXX_unrecognized)
  210. }
  211. return n
  212. }
  213. func (m *Snapshot) Size() (n int) {
  214. if m == nil {
  215. return 0
  216. }
  217. var l int
  218. _ = l
  219. n += 1 + sovRecord(uint64(m.Index))
  220. n += 1 + sovRecord(uint64(m.Term))
  221. if m.XXX_unrecognized != nil {
  222. n += len(m.XXX_unrecognized)
  223. }
  224. return n
  225. }
  226. func sovRecord(x uint64) (n int) {
  227. return (math_bits.Len64(x|1) + 6) / 7
  228. }
  229. func sozRecord(x uint64) (n int) {
  230. return sovRecord(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  231. }
  232. func (m *Record) Unmarshal(dAtA []byte) error {
  233. l := len(dAtA)
  234. iNdEx := 0
  235. for iNdEx < l {
  236. preIndex := iNdEx
  237. var wire uint64
  238. for shift := uint(0); ; shift += 7 {
  239. if shift >= 64 {
  240. return ErrIntOverflowRecord
  241. }
  242. if iNdEx >= l {
  243. return io.ErrUnexpectedEOF
  244. }
  245. b := dAtA[iNdEx]
  246. iNdEx++
  247. wire |= uint64(b&0x7F) << shift
  248. if b < 0x80 {
  249. break
  250. }
  251. }
  252. fieldNum := int32(wire >> 3)
  253. wireType := int(wire & 0x7)
  254. if wireType == 4 {
  255. return fmt.Errorf("proto: Record: wiretype end group for non-group")
  256. }
  257. if fieldNum <= 0 {
  258. return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire)
  259. }
  260. switch fieldNum {
  261. case 1:
  262. if wireType != 0 {
  263. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  264. }
  265. m.Type = 0
  266. for shift := uint(0); ; shift += 7 {
  267. if shift >= 64 {
  268. return ErrIntOverflowRecord
  269. }
  270. if iNdEx >= l {
  271. return io.ErrUnexpectedEOF
  272. }
  273. b := dAtA[iNdEx]
  274. iNdEx++
  275. m.Type |= int64(b&0x7F) << shift
  276. if b < 0x80 {
  277. break
  278. }
  279. }
  280. case 2:
  281. if wireType != 0 {
  282. return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType)
  283. }
  284. m.Crc = 0
  285. for shift := uint(0); ; shift += 7 {
  286. if shift >= 64 {
  287. return ErrIntOverflowRecord
  288. }
  289. if iNdEx >= l {
  290. return io.ErrUnexpectedEOF
  291. }
  292. b := dAtA[iNdEx]
  293. iNdEx++
  294. m.Crc |= uint32(b&0x7F) << shift
  295. if b < 0x80 {
  296. break
  297. }
  298. }
  299. case 3:
  300. if wireType != 2 {
  301. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  302. }
  303. var byteLen int
  304. for shift := uint(0); ; shift += 7 {
  305. if shift >= 64 {
  306. return ErrIntOverflowRecord
  307. }
  308. if iNdEx >= l {
  309. return io.ErrUnexpectedEOF
  310. }
  311. b := dAtA[iNdEx]
  312. iNdEx++
  313. byteLen |= int(b&0x7F) << shift
  314. if b < 0x80 {
  315. break
  316. }
  317. }
  318. if byteLen < 0 {
  319. return ErrInvalidLengthRecord
  320. }
  321. postIndex := iNdEx + byteLen
  322. if postIndex < 0 {
  323. return ErrInvalidLengthRecord
  324. }
  325. if postIndex > l {
  326. return io.ErrUnexpectedEOF
  327. }
  328. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  329. if m.Data == nil {
  330. m.Data = []byte{}
  331. }
  332. iNdEx = postIndex
  333. default:
  334. iNdEx = preIndex
  335. skippy, err := skipRecord(dAtA[iNdEx:])
  336. if err != nil {
  337. return err
  338. }
  339. if skippy < 0 {
  340. return ErrInvalidLengthRecord
  341. }
  342. if (iNdEx + skippy) < 0 {
  343. return ErrInvalidLengthRecord
  344. }
  345. if (iNdEx + skippy) > l {
  346. return io.ErrUnexpectedEOF
  347. }
  348. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  349. iNdEx += skippy
  350. }
  351. }
  352. if iNdEx > l {
  353. return io.ErrUnexpectedEOF
  354. }
  355. return nil
  356. }
  357. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  358. l := len(dAtA)
  359. iNdEx := 0
  360. for iNdEx < l {
  361. preIndex := iNdEx
  362. var wire uint64
  363. for shift := uint(0); ; shift += 7 {
  364. if shift >= 64 {
  365. return ErrIntOverflowRecord
  366. }
  367. if iNdEx >= l {
  368. return io.ErrUnexpectedEOF
  369. }
  370. b := dAtA[iNdEx]
  371. iNdEx++
  372. wire |= uint64(b&0x7F) << shift
  373. if b < 0x80 {
  374. break
  375. }
  376. }
  377. fieldNum := int32(wire >> 3)
  378. wireType := int(wire & 0x7)
  379. if wireType == 4 {
  380. return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  381. }
  382. if fieldNum <= 0 {
  383. return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  384. }
  385. switch fieldNum {
  386. case 1:
  387. if wireType != 0 {
  388. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  389. }
  390. m.Index = 0
  391. for shift := uint(0); ; shift += 7 {
  392. if shift >= 64 {
  393. return ErrIntOverflowRecord
  394. }
  395. if iNdEx >= l {
  396. return io.ErrUnexpectedEOF
  397. }
  398. b := dAtA[iNdEx]
  399. iNdEx++
  400. m.Index |= uint64(b&0x7F) << shift
  401. if b < 0x80 {
  402. break
  403. }
  404. }
  405. case 2:
  406. if wireType != 0 {
  407. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  408. }
  409. m.Term = 0
  410. for shift := uint(0); ; shift += 7 {
  411. if shift >= 64 {
  412. return ErrIntOverflowRecord
  413. }
  414. if iNdEx >= l {
  415. return io.ErrUnexpectedEOF
  416. }
  417. b := dAtA[iNdEx]
  418. iNdEx++
  419. m.Term |= uint64(b&0x7F) << shift
  420. if b < 0x80 {
  421. break
  422. }
  423. }
  424. default:
  425. iNdEx = preIndex
  426. skippy, err := skipRecord(dAtA[iNdEx:])
  427. if err != nil {
  428. return err
  429. }
  430. if skippy < 0 {
  431. return ErrInvalidLengthRecord
  432. }
  433. if (iNdEx + skippy) < 0 {
  434. return ErrInvalidLengthRecord
  435. }
  436. if (iNdEx + skippy) > l {
  437. return io.ErrUnexpectedEOF
  438. }
  439. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  440. iNdEx += skippy
  441. }
  442. }
  443. if iNdEx > l {
  444. return io.ErrUnexpectedEOF
  445. }
  446. return nil
  447. }
  448. func skipRecord(dAtA []byte) (n int, err error) {
  449. l := len(dAtA)
  450. iNdEx := 0
  451. for iNdEx < l {
  452. var wire uint64
  453. for shift := uint(0); ; shift += 7 {
  454. if shift >= 64 {
  455. return 0, ErrIntOverflowRecord
  456. }
  457. if iNdEx >= l {
  458. return 0, io.ErrUnexpectedEOF
  459. }
  460. b := dAtA[iNdEx]
  461. iNdEx++
  462. wire |= (uint64(b) & 0x7F) << shift
  463. if b < 0x80 {
  464. break
  465. }
  466. }
  467. wireType := int(wire & 0x7)
  468. switch wireType {
  469. case 0:
  470. for shift := uint(0); ; shift += 7 {
  471. if shift >= 64 {
  472. return 0, ErrIntOverflowRecord
  473. }
  474. if iNdEx >= l {
  475. return 0, io.ErrUnexpectedEOF
  476. }
  477. iNdEx++
  478. if dAtA[iNdEx-1] < 0x80 {
  479. break
  480. }
  481. }
  482. return iNdEx, nil
  483. case 1:
  484. iNdEx += 8
  485. return iNdEx, nil
  486. case 2:
  487. var length int
  488. for shift := uint(0); ; shift += 7 {
  489. if shift >= 64 {
  490. return 0, ErrIntOverflowRecord
  491. }
  492. if iNdEx >= l {
  493. return 0, io.ErrUnexpectedEOF
  494. }
  495. b := dAtA[iNdEx]
  496. iNdEx++
  497. length |= (int(b) & 0x7F) << shift
  498. if b < 0x80 {
  499. break
  500. }
  501. }
  502. if length < 0 {
  503. return 0, ErrInvalidLengthRecord
  504. }
  505. iNdEx += length
  506. if iNdEx < 0 {
  507. return 0, ErrInvalidLengthRecord
  508. }
  509. return iNdEx, nil
  510. case 3:
  511. for {
  512. var innerWire uint64
  513. var start int = iNdEx
  514. for shift := uint(0); ; shift += 7 {
  515. if shift >= 64 {
  516. return 0, ErrIntOverflowRecord
  517. }
  518. if iNdEx >= l {
  519. return 0, io.ErrUnexpectedEOF
  520. }
  521. b := dAtA[iNdEx]
  522. iNdEx++
  523. innerWire |= (uint64(b) & 0x7F) << shift
  524. if b < 0x80 {
  525. break
  526. }
  527. }
  528. innerWireType := int(innerWire & 0x7)
  529. if innerWireType == 4 {
  530. break
  531. }
  532. next, err := skipRecord(dAtA[start:])
  533. if err != nil {
  534. return 0, err
  535. }
  536. iNdEx = start + next
  537. if iNdEx < 0 {
  538. return 0, ErrInvalidLengthRecord
  539. }
  540. }
  541. return iNdEx, nil
  542. case 4:
  543. return iNdEx, nil
  544. case 5:
  545. iNdEx += 4
  546. return iNdEx, nil
  547. default:
  548. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  549. }
  550. }
  551. panic("unreachable")
  552. }
  553. var (
  554. ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling")
  555. ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow")
  556. )