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