record.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: record.proto
  3. /*
  4. Package walpb is a generated protocol buffer package.
  5. It is generated from these files:
  6. record.proto
  7. It has these top-level messages:
  8. Record
  9. Snapshot
  10. */
  11. package walpb
  12. import (
  13. "fmt"
  14. proto "github.com/golang/protobuf/proto"
  15. math "math"
  16. _ "github.com/gogo/protobuf/gogoproto"
  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 encodeVarintRecord(dAtA []byte, offset int, v uint64) int {
  108. for v >= 1<<7 {
  109. dAtA[offset] = uint8(v&0x7f | 0x80)
  110. v >>= 7
  111. offset++
  112. }
  113. dAtA[offset] = uint8(v)
  114. return offset + 1
  115. }
  116. func (m *Record) Size() (n int) {
  117. var l int
  118. _ = l
  119. n += 1 + sovRecord(uint64(m.Type))
  120. n += 1 + sovRecord(uint64(m.Crc))
  121. if m.Data != nil {
  122. l = len(m.Data)
  123. n += 1 + l + sovRecord(uint64(l))
  124. }
  125. if m.XXX_unrecognized != nil {
  126. n += len(m.XXX_unrecognized)
  127. }
  128. return n
  129. }
  130. func (m *Snapshot) Size() (n int) {
  131. var l int
  132. _ = l
  133. n += 1 + sovRecord(uint64(m.Index))
  134. n += 1 + sovRecord(uint64(m.Term))
  135. if m.XXX_unrecognized != nil {
  136. n += len(m.XXX_unrecognized)
  137. }
  138. return n
  139. }
  140. func sovRecord(x uint64) (n int) {
  141. for {
  142. n++
  143. x >>= 7
  144. if x == 0 {
  145. break
  146. }
  147. }
  148. return n
  149. }
  150. func sozRecord(x uint64) (n int) {
  151. return sovRecord(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  152. }
  153. func (m *Record) Unmarshal(dAtA []byte) error {
  154. l := len(dAtA)
  155. iNdEx := 0
  156. for iNdEx < l {
  157. preIndex := iNdEx
  158. var wire uint64
  159. for shift := uint(0); ; shift += 7 {
  160. if shift >= 64 {
  161. return ErrIntOverflowRecord
  162. }
  163. if iNdEx >= l {
  164. return io.ErrUnexpectedEOF
  165. }
  166. b := dAtA[iNdEx]
  167. iNdEx++
  168. wire |= (uint64(b) & 0x7F) << shift
  169. if b < 0x80 {
  170. break
  171. }
  172. }
  173. fieldNum := int32(wire >> 3)
  174. wireType := int(wire & 0x7)
  175. if wireType == 4 {
  176. return fmt.Errorf("proto: Record: wiretype end group for non-group")
  177. }
  178. if fieldNum <= 0 {
  179. return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire)
  180. }
  181. switch fieldNum {
  182. case 1:
  183. if wireType != 0 {
  184. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  185. }
  186. m.Type = 0
  187. for shift := uint(0); ; shift += 7 {
  188. if shift >= 64 {
  189. return ErrIntOverflowRecord
  190. }
  191. if iNdEx >= l {
  192. return io.ErrUnexpectedEOF
  193. }
  194. b := dAtA[iNdEx]
  195. iNdEx++
  196. m.Type |= (int64(b) & 0x7F) << shift
  197. if b < 0x80 {
  198. break
  199. }
  200. }
  201. case 2:
  202. if wireType != 0 {
  203. return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType)
  204. }
  205. m.Crc = 0
  206. for shift := uint(0); ; shift += 7 {
  207. if shift >= 64 {
  208. return ErrIntOverflowRecord
  209. }
  210. if iNdEx >= l {
  211. return io.ErrUnexpectedEOF
  212. }
  213. b := dAtA[iNdEx]
  214. iNdEx++
  215. m.Crc |= (uint32(b) & 0x7F) << shift
  216. if b < 0x80 {
  217. break
  218. }
  219. }
  220. case 3:
  221. if wireType != 2 {
  222. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  223. }
  224. var byteLen int
  225. for shift := uint(0); ; shift += 7 {
  226. if shift >= 64 {
  227. return ErrIntOverflowRecord
  228. }
  229. if iNdEx >= l {
  230. return io.ErrUnexpectedEOF
  231. }
  232. b := dAtA[iNdEx]
  233. iNdEx++
  234. byteLen |= (int(b) & 0x7F) << shift
  235. if b < 0x80 {
  236. break
  237. }
  238. }
  239. if byteLen < 0 {
  240. return ErrInvalidLengthRecord
  241. }
  242. postIndex := iNdEx + byteLen
  243. if postIndex > l {
  244. return io.ErrUnexpectedEOF
  245. }
  246. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  247. if m.Data == nil {
  248. m.Data = []byte{}
  249. }
  250. iNdEx = postIndex
  251. default:
  252. iNdEx = preIndex
  253. skippy, err := skipRecord(dAtA[iNdEx:])
  254. if err != nil {
  255. return err
  256. }
  257. if skippy < 0 {
  258. return ErrInvalidLengthRecord
  259. }
  260. if (iNdEx + skippy) > l {
  261. return io.ErrUnexpectedEOF
  262. }
  263. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  264. iNdEx += skippy
  265. }
  266. }
  267. if iNdEx > l {
  268. return io.ErrUnexpectedEOF
  269. }
  270. return nil
  271. }
  272. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  273. l := len(dAtA)
  274. iNdEx := 0
  275. for iNdEx < l {
  276. preIndex := iNdEx
  277. var wire uint64
  278. for shift := uint(0); ; shift += 7 {
  279. if shift >= 64 {
  280. return ErrIntOverflowRecord
  281. }
  282. if iNdEx >= l {
  283. return io.ErrUnexpectedEOF
  284. }
  285. b := dAtA[iNdEx]
  286. iNdEx++
  287. wire |= (uint64(b) & 0x7F) << shift
  288. if b < 0x80 {
  289. break
  290. }
  291. }
  292. fieldNum := int32(wire >> 3)
  293. wireType := int(wire & 0x7)
  294. if wireType == 4 {
  295. return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  296. }
  297. if fieldNum <= 0 {
  298. return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  299. }
  300. switch fieldNum {
  301. case 1:
  302. if wireType != 0 {
  303. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  304. }
  305. m.Index = 0
  306. for shift := uint(0); ; shift += 7 {
  307. if shift >= 64 {
  308. return ErrIntOverflowRecord
  309. }
  310. if iNdEx >= l {
  311. return io.ErrUnexpectedEOF
  312. }
  313. b := dAtA[iNdEx]
  314. iNdEx++
  315. m.Index |= (uint64(b) & 0x7F) << shift
  316. if b < 0x80 {
  317. break
  318. }
  319. }
  320. case 2:
  321. if wireType != 0 {
  322. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  323. }
  324. m.Term = 0
  325. for shift := uint(0); ; shift += 7 {
  326. if shift >= 64 {
  327. return ErrIntOverflowRecord
  328. }
  329. if iNdEx >= l {
  330. return io.ErrUnexpectedEOF
  331. }
  332. b := dAtA[iNdEx]
  333. iNdEx++
  334. m.Term |= (uint64(b) & 0x7F) << shift
  335. if b < 0x80 {
  336. break
  337. }
  338. }
  339. default:
  340. iNdEx = preIndex
  341. skippy, err := skipRecord(dAtA[iNdEx:])
  342. if err != nil {
  343. return err
  344. }
  345. if skippy < 0 {
  346. return ErrInvalidLengthRecord
  347. }
  348. if (iNdEx + skippy) > l {
  349. return io.ErrUnexpectedEOF
  350. }
  351. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  352. iNdEx += skippy
  353. }
  354. }
  355. if iNdEx > l {
  356. return io.ErrUnexpectedEOF
  357. }
  358. return nil
  359. }
  360. func skipRecord(dAtA []byte) (n int, err error) {
  361. l := len(dAtA)
  362. iNdEx := 0
  363. for iNdEx < l {
  364. var wire uint64
  365. for shift := uint(0); ; shift += 7 {
  366. if shift >= 64 {
  367. return 0, ErrIntOverflowRecord
  368. }
  369. if iNdEx >= l {
  370. return 0, io.ErrUnexpectedEOF
  371. }
  372. b := dAtA[iNdEx]
  373. iNdEx++
  374. wire |= (uint64(b) & 0x7F) << shift
  375. if b < 0x80 {
  376. break
  377. }
  378. }
  379. wireType := int(wire & 0x7)
  380. switch wireType {
  381. case 0:
  382. for shift := uint(0); ; shift += 7 {
  383. if shift >= 64 {
  384. return 0, ErrIntOverflowRecord
  385. }
  386. if iNdEx >= l {
  387. return 0, io.ErrUnexpectedEOF
  388. }
  389. iNdEx++
  390. if dAtA[iNdEx-1] < 0x80 {
  391. break
  392. }
  393. }
  394. return iNdEx, nil
  395. case 1:
  396. iNdEx += 8
  397. return iNdEx, nil
  398. case 2:
  399. var length int
  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. b := dAtA[iNdEx]
  408. iNdEx++
  409. length |= (int(b) & 0x7F) << shift
  410. if b < 0x80 {
  411. break
  412. }
  413. }
  414. iNdEx += length
  415. if length < 0 {
  416. return 0, ErrInvalidLengthRecord
  417. }
  418. return iNdEx, nil
  419. case 3:
  420. for {
  421. var innerWire uint64
  422. var start int = iNdEx
  423. for shift := uint(0); ; shift += 7 {
  424. if shift >= 64 {
  425. return 0, ErrIntOverflowRecord
  426. }
  427. if iNdEx >= l {
  428. return 0, io.ErrUnexpectedEOF
  429. }
  430. b := dAtA[iNdEx]
  431. iNdEx++
  432. innerWire |= (uint64(b) & 0x7F) << shift
  433. if b < 0x80 {
  434. break
  435. }
  436. }
  437. innerWireType := int(innerWire & 0x7)
  438. if innerWireType == 4 {
  439. break
  440. }
  441. next, err := skipRecord(dAtA[start:])
  442. if err != nil {
  443. return 0, err
  444. }
  445. iNdEx = start + next
  446. }
  447. return iNdEx, nil
  448. case 4:
  449. return iNdEx, nil
  450. case 5:
  451. iNdEx += 4
  452. return iNdEx, nil
  453. default:
  454. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  455. }
  456. }
  457. panic("unreachable")
  458. }
  459. var (
  460. ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling")
  461. ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow")
  462. )
  463. func init() { proto.RegisterFile("record.proto", fileDescriptorRecord) }
  464. var fileDescriptorRecord = []byte{
  465. // 186 bytes of a gzipped FileDescriptorProto
  466. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4a, 0x4d, 0xce,
  467. 0x2f, 0x4a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0x4f, 0xcc, 0x29, 0x48, 0x92,
  468. 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe8, 0x83, 0x58, 0x10, 0x49, 0x25, 0x3f, 0x2e, 0xb6,
  469. 0x20, 0xb0, 0x62, 0x21, 0x09, 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d,
  470. 0x66, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xc0, 0x22, 0x42, 0x62, 0x5c, 0xcc, 0xc9, 0x45,
  471. 0xc9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xbc, 0x50, 0x09, 0x90, 0x80, 0x90, 0x10, 0x17, 0x4b, 0x4a,
  472. 0x62, 0x49, 0xa2, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x98, 0xad, 0xe4, 0xc0, 0xc5, 0x11,
  473. 0x9c, 0x97, 0x58, 0x50, 0x9c, 0x91, 0x5f, 0x22, 0x24, 0xc5, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a,
  474. 0x01, 0x36, 0x92, 0x05, 0xaa, 0x13, 0x22, 0x04, 0xb6, 0x2d, 0xb5, 0x28, 0x17, 0x6c, 0x28, 0x0b,
  475. 0xdc, 0xb6, 0xd4, 0xa2, 0x5c, 0x27, 0x91, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc,
  476. 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19, 0x8f, 0xe5, 0x18, 0x00, 0x01, 0x00, 0x00,
  477. 0xff, 0xff, 0x7f, 0x5e, 0x5c, 0x46, 0xd3, 0x00, 0x00, 0x00,
  478. }