record.pb.go 12 KB

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