record.pb.go 12 KB

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