Skip to content
File

Blob: spec/protocol/config_vtproto.pb.go

go524 lines
1// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
2// protoc-gen-go-vtproto version: v0.6.0
3// source: spec/proto/config.proto
4 
5package protocol
6 
7import (
8 fmt "fmt"
9 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
10 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
11 io "io"
12)
13 
14const (
15 // Verify that this generated code is sufficiently up-to-date.
16 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17 // Verify that runtime/protoimpl is sufficiently up-to-date.
18 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19)
20 
21func (m *ConfigSnapshot) MarshalVT() (dAtA []byte, err error) {
22 if m == nil {
23 return nil, nil
24 }
25 size := m.SizeVT()
26 dAtA = make([]byte, size)
27 n, err := m.MarshalToSizedBufferVT(dAtA[:size])
28 if err != nil {
29 return nil, err
30 }
31 return dAtA[:n], nil
32}
33 
34func (m *ConfigSnapshot) MarshalToVT(dAtA []byte) (int, error) {
35 size := m.SizeVT()
36 return m.MarshalToSizedBufferVT(dAtA[:size])
37}
38 
39func (m *ConfigSnapshot) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
40 if m == nil {
41 return 0, nil
42 }
43 i := len(dAtA)
44 _ = i
45 var l int
46 _ = l
47 if m.unknownFields != nil {
48 i -= len(m.unknownFields)
49 copy(dAtA[i:], m.unknownFields)
50 }
51 if len(m.Data) > 0 {
52 i -= len(m.Data)
53 copy(dAtA[i:], m.Data)
54 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data)))
55 i--
56 dAtA[i] = 0xa
57 }
58 return len(dAtA) - i, nil
59}
60 
61func (m *ConfigGetRequest) MarshalVT() (dAtA []byte, err error) {
62 if m == nil {
63 return nil, nil
64 }
65 size := m.SizeVT()
66 dAtA = make([]byte, size)
67 n, err := m.MarshalToSizedBufferVT(dAtA[:size])
68 if err != nil {
69 return nil, err
70 }
71 return dAtA[:n], nil
72}
73 
74func (m *ConfigGetRequest) MarshalToVT(dAtA []byte) (int, error) {
75 size := m.SizeVT()
76 return m.MarshalToSizedBufferVT(dAtA[:size])
77}
78 
79func (m *ConfigGetRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
80 if m == nil {
81 return 0, nil
82 }
83 i := len(dAtA)
84 _ = i
85 var l int
86 _ = l
87 if m.unknownFields != nil {
88 i -= len(m.unknownFields)
89 copy(dAtA[i:], m.unknownFields)
90 }
91 if len(m.Name) > 0 {
92 i -= len(m.Name)
93 copy(dAtA[i:], m.Name)
94 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name)))
95 i--
96 dAtA[i] = 0xa
97 }
98 return len(dAtA) - i, nil
99}
100 
101func (m *ConfigRecord) MarshalVT() (dAtA []byte, err error) {
102 if m == nil {
103 return nil, nil
104 }
105 size := m.SizeVT()
106 dAtA = make([]byte, size)
107 n, err := m.MarshalToSizedBufferVT(dAtA[:size])
108 if err != nil {
109 return nil, err
110 }
111 return dAtA[:n], nil
112}
113 
114func (m *ConfigRecord) MarshalToVT(dAtA []byte) (int, error) {
115 size := m.SizeVT()
116 return m.MarshalToSizedBufferVT(dAtA[:size])
117}
118 
119func (m *ConfigRecord) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
120 if m == nil {
121 return 0, nil
122 }
123 i := len(dAtA)
124 _ = i
125 var l int
126 _ = l
127 if m.unknownFields != nil {
128 i -= len(m.unknownFields)
129 copy(dAtA[i:], m.unknownFields)
130 }
131 if len(m.Value) > 0 {
132 i -= len(m.Value)
133 copy(dAtA[i:], m.Value)
134 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value)))
135 i--
136 dAtA[i] = 0x1a
137 }
138 if len(m.Version) > 0 {
139 i -= len(m.Version)
140 copy(dAtA[i:], m.Version)
141 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version)))
142 i--
143 dAtA[i] = 0x12
144 }
145 if len(m.Name) > 0 {
146 i -= len(m.Name)
147 copy(dAtA[i:], m.Name)
148 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name)))
149 i--
150 dAtA[i] = 0xa
151 }
152 return len(dAtA) - i, nil
153}
154 
155func (m *ConfigSnapshot) SizeVT() (n int) {
156 if m == nil {
157 return 0
158 }
159 var l int
160 _ = l
161 l = len(m.Data)
162 if l > 0 {
163 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
164 }
165 n += len(m.unknownFields)
166 return n
167}
168 
169func (m *ConfigGetRequest) SizeVT() (n int) {
170 if m == nil {
171 return 0
172 }
173 var l int
174 _ = l
175 l = len(m.Name)
176 if l > 0 {
177 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
178 }
179 n += len(m.unknownFields)
180 return n
181}
182 
183func (m *ConfigRecord) SizeVT() (n int) {
184 if m == nil {
185 return 0
186 }
187 var l int
188 _ = l
189 l = len(m.Name)
190 if l > 0 {
191 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
192 }
193 l = len(m.Version)
194 if l > 0 {
195 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
196 }
197 l = len(m.Value)
198 if l > 0 {
199 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
200 }
201 n += len(m.unknownFields)
202 return n
203}
204 
205func (m *ConfigSnapshot) UnmarshalVT(dAtA []byte) error {
206 l := len(dAtA)
207 iNdEx := 0
208 for iNdEx < l {
209 preIndex := iNdEx
210 var wire uint64
211 for shift := uint(0); ; shift += 7 {
212 if shift >= 64 {
213 return protohelpers.ErrIntOverflow
214 }
215 if iNdEx >= l {
216 return io.ErrUnexpectedEOF
217 }
218 b := dAtA[iNdEx]
219 iNdEx++
220 wire |= uint64(b&0x7F) << shift
221 if b < 0x80 {
222 break
223 }
224 }
225 fieldNum := int32(wire >> 3)
226 wireType := int(wire & 0x7)
227 if wireType == 4 {
228 return fmt.Errorf("proto: ConfigSnapshot: wiretype end group for non-group")
229 }
230 if fieldNum <= 0 {
231 return fmt.Errorf("proto: ConfigSnapshot: illegal tag %d (wire type %d)", fieldNum, wire)
232 }
233 switch fieldNum {
234 case 1:
235 if wireType != 2 {
236 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
237 }
238 var byteLen int
239 for shift := uint(0); ; shift += 7 {
240 if shift >= 64 {
241 return protohelpers.ErrIntOverflow
242 }
243 if iNdEx >= l {
244 return io.ErrUnexpectedEOF
245 }
246 b := dAtA[iNdEx]
247 iNdEx++
248 byteLen |= int(b&0x7F) << shift
249 if b < 0x80 {
250 break
251 }
252 }
253 if byteLen < 0 {
254 return protohelpers.ErrInvalidLength
255 }
256 postIndex := iNdEx + byteLen
257 if postIndex < 0 {
258 return protohelpers.ErrInvalidLength
259 }
260 if postIndex > l {
261 return io.ErrUnexpectedEOF
262 }
263 m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
264 if m.Data == nil {
265 m.Data = []byte{}
266 }
267 iNdEx = postIndex
268 default:
269 iNdEx = preIndex
270 skippy, err := protohelpers.Skip(dAtA[iNdEx:])
271 if err != nil {
272 return err
273 }
274 if (skippy < 0) || (iNdEx+skippy) < 0 {
275 return protohelpers.ErrInvalidLength
276 }
277 if (iNdEx + skippy) > l {
278 return io.ErrUnexpectedEOF
279 }
280 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
281 iNdEx += skippy
282 }
283 }
284 
285 if iNdEx > l {
286 return io.ErrUnexpectedEOF
287 }
288 return nil
289}
290func (m *ConfigGetRequest) UnmarshalVT(dAtA []byte) error {
291 l := len(dAtA)
292 iNdEx := 0
293 for iNdEx < l {
294 preIndex := iNdEx
295 var wire uint64
296 for shift := uint(0); ; shift += 7 {
297 if shift >= 64 {
298 return protohelpers.ErrIntOverflow
299 }
300 if iNdEx >= l {
301 return io.ErrUnexpectedEOF
302 }
303 b := dAtA[iNdEx]
304 iNdEx++
305 wire |= uint64(b&0x7F) << shift
306 if b < 0x80 {
307 break
308 }
309 }
310 fieldNum := int32(wire >> 3)
311 wireType := int(wire & 0x7)
312 if wireType == 4 {
313 return fmt.Errorf("proto: ConfigGetRequest: wiretype end group for non-group")
314 }
315 if fieldNum <= 0 {
316 return fmt.Errorf("proto: ConfigGetRequest: illegal tag %d (wire type %d)", fieldNum, wire)
317 }
318 switch fieldNum {
319 case 1:
320 if wireType != 2 {
321 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
322 }
323 var stringLen uint64
324 for shift := uint(0); ; shift += 7 {
325 if shift >= 64 {
326 return protohelpers.ErrIntOverflow
327 }
328 if iNdEx >= l {
329 return io.ErrUnexpectedEOF
330 }
331 b := dAtA[iNdEx]
332 iNdEx++
333 stringLen |= uint64(b&0x7F) << shift
334 if b < 0x80 {
335 break
336 }
337 }
338 intStringLen := int(stringLen)
339 if intStringLen < 0 {
340 return protohelpers.ErrInvalidLength
341 }
342 postIndex := iNdEx + intStringLen
343 if postIndex < 0 {
344 return protohelpers.ErrInvalidLength
345 }
346 if postIndex > l {
347 return io.ErrUnexpectedEOF
348 }
349 m.Name = string(dAtA[iNdEx:postIndex])
350 iNdEx = postIndex
351 default:
352 iNdEx = preIndex
353 skippy, err := protohelpers.Skip(dAtA[iNdEx:])
354 if err != nil {
355 return err
356 }
357 if (skippy < 0) || (iNdEx+skippy) < 0 {
358 return protohelpers.ErrInvalidLength
359 }
360 if (iNdEx + skippy) > l {
361 return io.ErrUnexpectedEOF
362 }
363 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
364 iNdEx += skippy
365 }
366 }
367 
368 if iNdEx > l {
369 return io.ErrUnexpectedEOF
370 }
371 return nil
372}
373func (m *ConfigRecord) UnmarshalVT(dAtA []byte) error {
374 l := len(dAtA)
375 iNdEx := 0
376 for iNdEx < l {
377 preIndex := iNdEx
378 var wire uint64
379 for shift := uint(0); ; shift += 7 {
380 if shift >= 64 {
381 return protohelpers.ErrIntOverflow
382 }
383 if iNdEx >= l {
384 return io.ErrUnexpectedEOF
385 }
386 b := dAtA[iNdEx]
387 iNdEx++
388 wire |= uint64(b&0x7F) << shift
389 if b < 0x80 {
390 break
391 }
392 }
393 fieldNum := int32(wire >> 3)
394 wireType := int(wire & 0x7)
395 if wireType == 4 {
396 return fmt.Errorf("proto: ConfigRecord: wiretype end group for non-group")
397 }
398 if fieldNum <= 0 {
399 return fmt.Errorf("proto: ConfigRecord: illegal tag %d (wire type %d)", fieldNum, wire)
400 }
401 switch fieldNum {
402 case 1:
403 if wireType != 2 {
404 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
405 }
406 var stringLen uint64
407 for shift := uint(0); ; shift += 7 {
408 if shift >= 64 {
409 return protohelpers.ErrIntOverflow
410 }
411 if iNdEx >= l {
412 return io.ErrUnexpectedEOF
413 }
414 b := dAtA[iNdEx]
415 iNdEx++
416 stringLen |= uint64(b&0x7F) << shift
417 if b < 0x80 {
418 break
419 }
420 }
421 intStringLen := int(stringLen)
422 if intStringLen < 0 {
423 return protohelpers.ErrInvalidLength
424 }
425 postIndex := iNdEx + intStringLen
426 if postIndex < 0 {
427 return protohelpers.ErrInvalidLength
428 }
429 if postIndex > l {
430 return io.ErrUnexpectedEOF
431 }
432 m.Name = string(dAtA[iNdEx:postIndex])
433 iNdEx = postIndex
434 case 2:
435 if wireType != 2 {
436 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
437 }
438 var byteLen int
439 for shift := uint(0); ; shift += 7 {
440 if shift >= 64 {
441 return protohelpers.ErrIntOverflow
442 }
443 if iNdEx >= l {
444 return io.ErrUnexpectedEOF
445 }
446 b := dAtA[iNdEx]
447 iNdEx++
448 byteLen |= int(b&0x7F) << shift
449 if b < 0x80 {
450 break
451 }
452 }
453 if byteLen < 0 {
454 return protohelpers.ErrInvalidLength
455 }
456 postIndex := iNdEx + byteLen
457 if postIndex < 0 {
458 return protohelpers.ErrInvalidLength
459 }
460 if postIndex > l {
461 return io.ErrUnexpectedEOF
462 }
463 m.Version = append(m.Version[:0], dAtA[iNdEx:postIndex]...)
464 if m.Version == nil {
465 m.Version = []byte{}
466 }
467 iNdEx = postIndex
468 case 3:
469 if wireType != 2 {
470 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
471 }
472 var byteLen int
473 for shift := uint(0); ; shift += 7 {
474 if shift >= 64 {
475 return protohelpers.ErrIntOverflow
476 }
477 if iNdEx >= l {
478 return io.ErrUnexpectedEOF
479 }
480 b := dAtA[iNdEx]
481 iNdEx++
482 byteLen |= int(b&0x7F) << shift
483 if b < 0x80 {
484 break
485 }
486 }
487 if byteLen < 0 {
488 return protohelpers.ErrInvalidLength
489 }
490 postIndex := iNdEx + byteLen
491 if postIndex < 0 {
492 return protohelpers.ErrInvalidLength
493 }
494 if postIndex > l {
495 return io.ErrUnexpectedEOF
496 }
497 m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
498 if m.Value == nil {
499 m.Value = []byte{}
500 }
501 iNdEx = postIndex
502 default:
503 iNdEx = preIndex
504 skippy, err := protohelpers.Skip(dAtA[iNdEx:])
505 if err != nil {
506 return err
507 }
508 if (skippy < 0) || (iNdEx+skippy) < 0 {
509 return protohelpers.ErrInvalidLength
510 }
511 if (iNdEx + skippy) > l {
512 return io.ErrUnexpectedEOF
513 }
514 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
515 iNdEx += skippy
516 }
517 }
518 
519 if iNdEx > l {
520 return io.ErrUnexpectedEOF
521 }
522 return nil
523}