etcd/wal/walpb/record.pb.go

505 lines
12 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-gogo. DO NOT EDIT.
2014-08-05 02:46:12 +04:00
// source: record.proto
/*
2014-09-04 03:46:42 +04:00
Package walpb is a generated protocol buffer package.
2014-08-05 02:46:12 +04:00
It is generated from these files:
record.proto
It has these top-level messages:
Record
2015-01-06 10:27:03 +03:00
Snapshot
2014-08-05 02:46:12 +04:00
*/
2014-09-04 03:46:42 +04:00
package walpb
2014-08-05 02:46:12 +04:00
2016-01-27 04:41:39 +03:00
import (
"fmt"
2014-08-05 02:46:12 +04:00
2016-07-18 19:33:32 +03:00
proto "github.com/golang/protobuf/proto"
2014-08-05 02:46:12 +04:00
2016-04-14 02:23:07 +03:00
math "math"
_ "github.com/gogo/protobuf/gogoproto"
2016-10-04 00:43:06 +03:00
io "io"
)
2014-08-05 02:46:12 +04:00
2015-03-25 20:02:00 +03:00
// Reference imports to suppress errors if they are not otherwise used.
2014-08-05 02:46:12 +04:00
var _ = proto.Marshal
2016-01-27 04:41:39 +03:00
var _ = fmt.Errorf
2014-08-05 02:46:12 +04:00
var _ = math.Inf
2016-04-26 00:08:33 +03:00
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
2016-11-10 22:53:48 +03:00
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
2016-04-26 00:08:33 +03:00
2014-08-05 02:46:12 +04:00
type Record struct {
2015-06-30 04:37:52 +03:00
Type int64 `protobuf:"varint,1,opt,name=type" json:"type"`
Crc uint32 `protobuf:"varint,2,opt,name=crc" json:"crc"`
2014-08-05 02:46:12 +04:00
Data []byte `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
2016-04-26 00:08:33 +03:00
func (m *Record) Reset() { *m = Record{} }
func (m *Record) String() string { return proto.CompactTextString(m) }
func (*Record) ProtoMessage() {}
func (*Record) Descriptor() ([]byte, []int) { return fileDescriptorRecord, []int{0} }
2014-08-05 02:46:12 +04:00
2015-01-06 10:27:03 +03:00
type Snapshot struct {
2015-06-30 04:37:52 +03:00
Index uint64 `protobuf:"varint,1,opt,name=index" json:"index"`
Term uint64 `protobuf:"varint,2,opt,name=term" json:"term"`
2015-01-06 10:27:03 +03:00
XXX_unrecognized []byte `json:"-"`
}
2016-04-26 00:08:33 +03:00
func (m *Snapshot) Reset() { *m = Snapshot{} }
func (m *Snapshot) String() string { return proto.CompactTextString(m) }
func (*Snapshot) ProtoMessage() {}
func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptorRecord, []int{1} }
2015-01-06 10:27:03 +03:00
2016-01-27 04:41:39 +03:00
func init() {
proto.RegisterType((*Record)(nil), "walpb.Record")
proto.RegisterType((*Snapshot)(nil), "walpb.Snapshot")
}
2016-11-10 22:53:48 +03:00
func (m *Record) Marshal() (dAtA []byte, err error) {
2015-09-04 01:32:25 +03:00
size := m.Size()
2016-11-10 22:53:48 +03:00
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
2015-09-04 01:32:25 +03:00
if err != nil {
return nil, err
}
2016-11-10 22:53:48 +03:00
return dAtA[:n], nil
2015-09-04 01:32:25 +03:00
}
2016-11-10 22:53:48 +03:00
func (m *Record) MarshalTo(dAtA []byte) (int, error) {
2015-09-04 01:32:25 +03:00
var i int
_ = i
var l int
_ = l
2016-11-10 22:53:48 +03:00
dAtA[i] = 0x8
2015-09-04 01:32:25 +03:00
i++
2016-11-10 22:53:48 +03:00
i = encodeVarintRecord(dAtA, i, uint64(m.Type))
dAtA[i] = 0x10
2015-09-04 01:32:25 +03:00
i++
2016-11-10 22:53:48 +03:00
i = encodeVarintRecord(dAtA, i, uint64(m.Crc))
2015-09-04 01:32:25 +03:00
if m.Data != nil {
2016-11-10 22:53:48 +03:00
dAtA[i] = 0x1a
2015-09-04 01:32:25 +03:00
i++
2016-11-10 22:53:48 +03:00
i = encodeVarintRecord(dAtA, i, uint64(len(m.Data)))
i += copy(dAtA[i:], m.Data)
2015-09-04 01:32:25 +03:00
}
if m.XXX_unrecognized != nil {
2016-11-10 22:53:48 +03:00
i += copy(dAtA[i:], m.XXX_unrecognized)
2015-09-04 01:32:25 +03:00
}
return i, nil
}
2016-11-10 22:53:48 +03:00
func (m *Snapshot) Marshal() (dAtA []byte, err error) {
2015-09-04 01:32:25 +03:00
size := m.Size()
2016-11-10 22:53:48 +03:00
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
2015-09-04 01:32:25 +03:00
if err != nil {
return nil, err
}
2016-11-10 22:53:48 +03:00
return dAtA[:n], nil
2015-09-04 01:32:25 +03:00
}
2016-11-10 22:53:48 +03:00
func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
2015-09-04 01:32:25 +03:00
var i int
_ = i
var l int
_ = l
2016-11-10 22:53:48 +03:00
dAtA[i] = 0x8
2015-09-04 01:32:25 +03:00
i++
2016-11-10 22:53:48 +03:00
i = encodeVarintRecord(dAtA, i, uint64(m.Index))
dAtA[i] = 0x10
2015-09-04 01:32:25 +03:00
i++
2016-11-10 22:53:48 +03:00
i = encodeVarintRecord(dAtA, i, uint64(m.Term))
2015-09-04 01:32:25 +03:00
if m.XXX_unrecognized != nil {
2016-11-10 22:53:48 +03:00
i += copy(dAtA[i:], m.XXX_unrecognized)
2015-09-04 01:32:25 +03:00
}
return i, nil
}
2016-11-10 22:53:48 +03:00
func encodeVarintRecord(dAtA []byte, offset int, v uint64) int {
2015-09-04 01:32:25 +03:00
for v >= 1<<7 {
2016-11-10 22:53:48 +03:00
dAtA[offset] = uint8(v&0x7f | 0x80)
2015-09-04 01:32:25 +03:00
v >>= 7
offset++
}
2016-11-10 22:53:48 +03:00
dAtA[offset] = uint8(v)
2015-09-04 01:32:25 +03:00
return offset + 1
}
func (m *Record) Size() (n int) {
var l int
_ = l
n += 1 + sovRecord(uint64(m.Type))
n += 1 + sovRecord(uint64(m.Crc))
if m.Data != nil {
l = len(m.Data)
n += 1 + l + sovRecord(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func (m *Snapshot) Size() (n int) {
var l int
_ = l
n += 1 + sovRecord(uint64(m.Index))
n += 1 + sovRecord(uint64(m.Term))
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovRecord(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozRecord(x uint64) (n int) {
return sovRecord(uint64((x << 1) ^ uint64((int64(x) >> 63))))
2014-08-05 02:46:12 +04:00
}
2016-11-10 22:53:48 +03:00
func (m *Record) Unmarshal(dAtA []byte) error {
l := len(dAtA)
2015-06-30 02:05:55 +03:00
iNdEx := 0
for iNdEx < l {
2016-01-27 04:41:39 +03:00
preIndex := iNdEx
2014-08-05 02:46:12 +04:00
var wire uint64
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2014-08-05 02:46:12 +04:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2014-08-05 02:46:12 +04:00
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
2016-01-27 04:41:39 +03:00
if wireType == 4 {
return fmt.Errorf("proto: Record: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire)
}
2014-08-05 02:46:12 +04:00
switch fieldNum {
case 1:
if wireType != 0 {
2015-03-25 20:02:00 +03:00
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
2014-08-05 02:46:12 +04:00
}
2015-09-04 01:32:25 +03:00
m.Type = 0
2014-08-05 02:46:12 +04:00
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2014-08-05 02:46:12 +04:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2014-08-05 02:46:12 +04:00
m.Type |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
2015-03-25 20:02:00 +03:00
return fmt.Errorf("proto: wrong wireType = %d for field Crc", wireType)
2014-08-05 02:46:12 +04:00
}
2015-09-04 01:32:25 +03:00
m.Crc = 0
2014-08-05 02:46:12 +04:00
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2014-08-05 02:46:12 +04:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2014-09-04 02:10:15 +04:00
m.Crc |= (uint32(b) & 0x7F) << shift
2014-08-05 02:46:12 +04:00
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
2015-03-25 20:02:00 +03:00
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
2014-08-05 02:46:12 +04:00
}
var byteLen int
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2014-08-05 02:46:12 +04:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2014-08-05 02:46:12 +04:00
byteLen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
2015-09-04 01:32:25 +03:00
if byteLen < 0 {
return ErrInvalidLengthRecord
}
2015-06-30 02:05:55 +03:00
postIndex := iNdEx + byteLen
2014-08-05 02:46:12 +04:00
if postIndex > l {
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
2016-01-27 04:41:39 +03:00
if m.Data == nil {
m.Data = []byte{}
}
2015-06-30 02:05:55 +03:00
iNdEx = postIndex
2014-08-05 02:46:12 +04:00
default:
2016-01-27 04:41:39 +03:00
iNdEx = preIndex
2016-11-10 22:53:48 +03:00
skippy, err := skipRecord(dAtA[iNdEx:])
2014-08-05 02:46:12 +04:00
if err != nil {
return err
}
2015-09-04 01:32:25 +03:00
if skippy < 0 {
return ErrInvalidLengthRecord
}
2015-06-30 02:05:55 +03:00
if (iNdEx + skippy) > l {
2014-08-05 02:46:12 +04:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
2015-06-30 02:05:55 +03:00
iNdEx += skippy
2014-08-05 02:46:12 +04:00
}
}
2015-06-30 02:05:55 +03:00
2016-01-27 04:41:39 +03:00
if iNdEx > l {
return io.ErrUnexpectedEOF
}
2014-08-05 02:46:12 +04:00
return nil
}
2016-11-10 22:53:48 +03:00
func (m *Snapshot) Unmarshal(dAtA []byte) error {
l := len(dAtA)
2015-06-30 02:05:55 +03:00
iNdEx := 0
for iNdEx < l {
2016-01-27 04:41:39 +03:00
preIndex := iNdEx
2015-01-06 10:27:03 +03:00
var wire uint64
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2015-01-06 10:27:03 +03:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2015-01-06 10:27:03 +03:00
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
2016-01-27 04:41:39 +03:00
if wireType == 4 {
return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
}
2015-01-06 10:27:03 +03:00
switch fieldNum {
case 1:
if wireType != 0 {
2015-03-25 20:02:00 +03:00
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
2015-01-06 10:27:03 +03:00
}
2015-09-04 01:32:25 +03:00
m.Index = 0
2015-01-06 10:27:03 +03:00
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2015-01-06 10:27:03 +03:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2015-01-06 10:27:03 +03:00
m.Index |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
2015-03-25 20:02:00 +03:00
return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
2015-01-06 10:27:03 +03:00
}
2015-09-04 01:32:25 +03:00
m.Term = 0
2015-01-06 10:27:03 +03:00
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
2015-01-06 10:27:03 +03:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
2015-01-06 10:27:03 +03:00
m.Term |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
default:
2016-01-27 04:41:39 +03:00
iNdEx = preIndex
2016-11-10 22:53:48 +03:00
skippy, err := skipRecord(dAtA[iNdEx:])
2015-01-06 10:27:03 +03:00
if err != nil {
return err
}
2015-09-04 01:32:25 +03:00
if skippy < 0 {
return ErrInvalidLengthRecord
}
2015-06-30 02:05:55 +03:00
if (iNdEx + skippy) > l {
2015-01-06 10:27:03 +03:00
return io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
2015-06-30 02:05:55 +03:00
iNdEx += skippy
2015-01-06 10:27:03 +03:00
}
}
2015-06-30 02:05:55 +03:00
2016-01-27 04:41:39 +03:00
if iNdEx > l {
return io.ErrUnexpectedEOF
}
2015-01-06 10:27:03 +03:00
return nil
}
2016-11-10 22:53:48 +03:00
func skipRecord(dAtA []byte) (n int, err error) {
l := len(dAtA)
2015-06-30 02:05:55 +03:00
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return 0, ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
2016-01-27 04:41:39 +03:00
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
2016-11-10 22:53:48 +03:00
if dAtA[iNdEx-1] < 0x80 {
2015-06-30 02:05:55 +03:00
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return 0, ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
2015-09-04 01:32:25 +03:00
if length < 0 {
return 0, ErrInvalidLengthRecord
}
2015-06-30 02:05:55 +03:00
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
2016-01-27 04:41:39 +03:00
if shift >= 64 {
return 0, ErrIntOverflowRecord
}
2015-06-30 02:05:55 +03:00
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
2016-11-10 22:53:48 +03:00
b := dAtA[iNdEx]
2015-06-30 02:05:55 +03:00
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
2016-11-10 22:53:48 +03:00
next, err := skipRecord(dAtA[start:])
2015-06-30 02:05:55 +03:00
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
2015-03-25 20:02:00 +03:00
2015-09-04 01:32:25 +03:00
var (
ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling")
2016-01-27 04:41:39 +03:00
ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow")
2015-09-04 01:32:25 +03:00
)
2016-04-26 00:08:33 +03:00
2016-11-10 22:53:48 +03:00
func init() { proto.RegisterFile("record.proto", fileDescriptorRecord) }
2016-04-26 00:08:33 +03:00
var fileDescriptorRecord = []byte{
2016-10-04 00:43:06 +03:00
// 186 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4a, 0x4d, 0xce,
2016-04-26 00:08:33 +03:00
0x2f, 0x4a, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0x4f, 0xcc, 0x29, 0x48, 0x92,
2016-05-03 09:02:31 +03:00
0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe8, 0x83, 0x58, 0x10, 0x49, 0x25, 0x3f, 0x2e, 0xb6,
0x20, 0xb0, 0x62, 0x21, 0x09, 0x2e, 0x96, 0x92, 0xca, 0x82, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d,
0x66, 0x27, 0x96, 0x13, 0xf7, 0xe4, 0x19, 0x82, 0xc0, 0x22, 0x42, 0x62, 0x5c, 0xcc, 0xc9, 0x45,
2016-10-04 00:43:06 +03:00
0xc9, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xbc, 0x50, 0x09, 0x90, 0x80, 0x90, 0x10, 0x17, 0x4b, 0x4a,
0x62, 0x49, 0xa2, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x98, 0xad, 0xe4, 0xc0, 0xc5, 0x11,
0x9c, 0x97, 0x58, 0x50, 0x9c, 0x91, 0x5f, 0x22, 0x24, 0xc5, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a,
0x01, 0x36, 0x92, 0x05, 0xaa, 0x13, 0x22, 0x04, 0xb6, 0x2d, 0xb5, 0x28, 0x17, 0x6c, 0x28, 0x0b,
0xdc, 0xb6, 0xd4, 0xa2, 0x5c, 0x27, 0x91, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc,
0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19, 0x8f, 0xe5, 0x18, 0x00, 0x01, 0x00, 0x00,
0xff, 0xff, 0x7f, 0x5e, 0x5c, 0x46, 0xd3, 0x00, 0x00, 0x00,
2016-04-26 00:08:33 +03:00
}