Skip to content
File

Blob: kv/aof/proto/log_vtproto.pb.go

go237 lines
1// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
2// protoc-gen-go-vtproto version: v0.6.0
3// source: kv/aof/proto/log.proto
4 
5package proto
6 
7import (
8 fmt "fmt"
9 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
10 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
11 io "io"
12 sync "sync"
13)
14 
15const (
16 // Verify that this generated code is sufficiently up-to-date.
17 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18 // Verify that runtime/protoimpl is sufficiently up-to-date.
19 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20)
21 
22func (m *LogEntry) MarshalVT() (dAtA []byte, err error) {
23 if m == nil {
24 return nil, nil
25 }
26 size := m.SizeVT()
27 dAtA = make([]byte, size)
28 n, err := m.MarshalToSizedBufferVT(dAtA[:size])
29 if err != nil {
30 return nil, err
31 }
32 return dAtA[:n], nil
33}
34 
35func (m *LogEntry) MarshalToVT(dAtA []byte) (int, error) {
36 size := m.SizeVT()
37 return m.MarshalToSizedBufferVT(dAtA[:size])
38}
39 
40func (m *LogEntry) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
41 if m == nil {
42 return 0, nil
43 }
44 i := len(dAtA)
45 _ = i
46 var l int
47 _ = l
48 if m.unknownFields != nil {
49 i -= len(m.unknownFields)
50 copy(dAtA[i:], m.unknownFields)
51 }
52 if m.Checksum != 0 {
53 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Checksum))
54 i--
55 dAtA[i] = 0x28
56 }
57 if len(m.Data) > 0 {
58 i -= len(m.Data)
59 copy(dAtA[i:], m.Data)
60 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data)))
61 i--
62 dAtA[i] = 0x12
63 }
64 if m.Version != 0 {
65 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Version))
66 i--
67 dAtA[i] = 0x8
68 }
69 return len(dAtA) - i, nil
70}
71 
72var vtprotoPool_LogEntry = sync.Pool{
73 New: func() interface{} {
74 return &LogEntry{}
75 },
76}
77 
78func (m *LogEntry) ResetVT() {
79 if m != nil {
80 f0 := m.Data[:0]
81 m.Reset()
82 m.Data = f0
83 }
84}
85func (m *LogEntry) ReturnToVTPool() {
86 if m != nil {
87 m.ResetVT()
88 vtprotoPool_LogEntry.Put(m)
89 }
90}
91func LogEntryFromVTPool() *LogEntry {
92 return vtprotoPool_LogEntry.Get().(*LogEntry)
93}
94func (m *LogEntry) SizeVT() (n int) {
95 if m == nil {
96 return 0
97 }
98 var l int
99 _ = l
100 if m.Version != 0 {
101 n += 1 + protohelpers.SizeOfVarint(uint64(m.Version))
102 }
103 l = len(m.Data)
104 if l > 0 {
105 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
106 }
107 if m.Checksum != 0 {
108 n += 1 + protohelpers.SizeOfVarint(uint64(m.Checksum))
109 }
110 n += len(m.unknownFields)
111 return n
112}
113 
114func (m *LogEntry) UnmarshalVT(dAtA []byte) error {
115 l := len(dAtA)
116 iNdEx := 0
117 for iNdEx < l {
118 preIndex := iNdEx
119 var wire uint64
120 for shift := uint(0); ; shift += 7 {
121 if shift >= 64 {
122 return protohelpers.ErrIntOverflow
123 }
124 if iNdEx >= l {
125 return io.ErrUnexpectedEOF
126 }
127 b := dAtA[iNdEx]
128 iNdEx++
129 wire |= uint64(b&0x7F) << shift
130 if b < 0x80 {
131 break
132 }
133 }
134 fieldNum := int32(wire >> 3)
135 wireType := int(wire & 0x7)
136 if wireType == 4 {
137 return fmt.Errorf("proto: LogEntry: wiretype end group for non-group")
138 }
139 if fieldNum <= 0 {
140 return fmt.Errorf("proto: LogEntry: illegal tag %d (wire type %d)", fieldNum, wire)
141 }
142 switch fieldNum {
143 case 1:
144 if wireType != 0 {
145 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
146 }
147 m.Version = 0
148 for shift := uint(0); ; shift += 7 {
149 if shift >= 64 {
150 return protohelpers.ErrIntOverflow
151 }
152 if iNdEx >= l {
153 return io.ErrUnexpectedEOF
154 }
155 b := dAtA[iNdEx]
156 iNdEx++
157 m.Version |= LogVersion(b&0x7F) << shift
158 if b < 0x80 {
159 break
160 }
161 }
162 case 2:
163 if wireType != 2 {
164 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
165 }
166 var byteLen int
167 for shift := uint(0); ; shift += 7 {
168 if shift >= 64 {
169 return protohelpers.ErrIntOverflow
170 }
171 if iNdEx >= l {
172 return io.ErrUnexpectedEOF
173 }
174 b := dAtA[iNdEx]
175 iNdEx++
176 byteLen |= int(b&0x7F) << shift
177 if b < 0x80 {
178 break
179 }
180 }
181 if byteLen < 0 {
182 return protohelpers.ErrInvalidLength
183 }
184 postIndex := iNdEx + byteLen
185 if postIndex < 0 {
186 return protohelpers.ErrInvalidLength
187 }
188 if postIndex > l {
189 return io.ErrUnexpectedEOF
190 }
191 m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
192 if m.Data == nil {
193 m.Data = []byte{}
194 }
195 iNdEx = postIndex
196 case 5:
197 if wireType != 0 {
198 return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType)
199 }
200 m.Checksum = 0
201 for shift := uint(0); ; shift += 7 {
202 if shift >= 64 {
203 return protohelpers.ErrIntOverflow
204 }
205 if iNdEx >= l {
206 return io.ErrUnexpectedEOF
207 }
208 b := dAtA[iNdEx]
209 iNdEx++
210 m.Checksum |= uint64(b&0x7F) << shift
211 if b < 0x80 {
212 break
213 }
214 }
215 default:
216 iNdEx = preIndex
217 skippy, err := protohelpers.Skip(dAtA[iNdEx:])
218 if err != nil {
219 return err
220 }
221 if (skippy < 0) || (iNdEx+skippy) < 0 {
222 return protohelpers.ErrInvalidLength
223 }
224 if (iNdEx + skippy) > l {
225 return io.ErrUnexpectedEOF
226 }
227 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
228 iNdEx += skippy
229 }
230 }
231 
232 if iNdEx > l {
233 return io.ErrUnexpectedEOF
234 }
235 return nil
236}