Skip to content
File

Blob: spec/protocol/rpc_vtproto.pb.go

go142 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/rpc.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 *Context) 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 *Context) MarshalToVT(dAtA []byte) (int, error) {
35 size := m.SizeVT()
36 return m.MarshalToSizedBufferVT(dAtA[:size])
37}
38 
39func (m *Context) 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.RequestTarget != 0 {
52 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RequestTarget))
53 i--
54 dAtA[i] = 0x8
55 }
56 return len(dAtA) - i, nil
57}
58 
59func (m *Context) SizeVT() (n int) {
60 if m == nil {
61 return 0
62 }
63 var l int
64 _ = l
65 if m.RequestTarget != 0 {
66 n += 1 + protohelpers.SizeOfVarint(uint64(m.RequestTarget))
67 }
68 n += len(m.unknownFields)
69 return n
70}
71 
72func (m *Context) UnmarshalVT(dAtA []byte) error {
73 l := len(dAtA)
74 iNdEx := 0
75 for iNdEx < l {
76 preIndex := iNdEx
77 var wire uint64
78 for shift := uint(0); ; shift += 7 {
79 if shift >= 64 {
80 return protohelpers.ErrIntOverflow
81 }
82 if iNdEx >= l {
83 return io.ErrUnexpectedEOF
84 }
85 b := dAtA[iNdEx]
86 iNdEx++
87 wire |= uint64(b&0x7F) << shift
88 if b < 0x80 {
89 break
90 }
91 }
92 fieldNum := int32(wire >> 3)
93 wireType := int(wire & 0x7)
94 if wireType == 4 {
95 return fmt.Errorf("proto: Context: wiretype end group for non-group")
96 }
97 if fieldNum <= 0 {
98 return fmt.Errorf("proto: Context: illegal tag %d (wire type %d)", fieldNum, wire)
99 }
100 switch fieldNum {
101 case 1:
102 if wireType != 0 {
103 return fmt.Errorf("proto: wrong wireType = %d for field RequestTarget", wireType)
104 }
105 m.RequestTarget = 0
106 for shift := uint(0); ; shift += 7 {
107 if shift >= 64 {
108 return protohelpers.ErrIntOverflow
109 }
110 if iNdEx >= l {
111 return io.ErrUnexpectedEOF
112 }
113 b := dAtA[iNdEx]
114 iNdEx++
115 m.RequestTarget |= Context_TargetType(b&0x7F) << shift
116 if b < 0x80 {
117 break
118 }
119 }
120 default:
121 iNdEx = preIndex
122 skippy, err := protohelpers.Skip(dAtA[iNdEx:])
123 if err != nil {
124 return err
125 }
126 if (skippy < 0) || (iNdEx+skippy) < 0 {
127 return protohelpers.ErrInvalidLength
128 }
129 if (iNdEx + skippy) > l {
130 return io.ErrUnexpectedEOF
131 }
132 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
133 iNdEx += skippy
134 }
135 }
136 
137 if iNdEx > l {
138 return io.ErrUnexpectedEOF
139 }
140 return nil
141}