Skip to content
File

Blob: spec/protocol/pki_vtproto.pb.go

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