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