Debian Codegraph @

envoy/config/common/mutation_rules/v3/mutation_rules_vtproto.pb.go

raw
1 //go:build vtprotobuf
2 // +build vtprotobuf
3
4 // Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
5 // source: envoy/config/common/mutation_rules/v3/mutation_rules.proto
6
7 package mutation_rulesv3
8
9 import (
10 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
11 wrapperspb "github.com/planetscale/vtprotobuf/types/known/wrapperspb"
12 proto "google.golang.org/protobuf/proto"
13 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
14 )
15
16 const (
17 // Verify that this generated code is sufficiently up-to-date.
18 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
19 // Verify that runtime/protoimpl is sufficiently up-to-date.
20 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
21 )
22
23 func (m *HeaderMutationRules) MarshalVTStrict() (dAtA []byte, err error) {
24 if m == nil {
25 return nil, nil
26 }
27 size := m.SizeVT()
28 dAtA = make([]byte, size)
29 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
30 if err != nil {
31 return nil, err
32 }
33 return dAtA[:n], nil
34 }
35
36 func (m *HeaderMutationRules) MarshalToVTStrict(dAtA []byte) (int, error) {
37 size := m.SizeVT()
38 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
39 }
40
41 func (m *HeaderMutationRules) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
42 if m == nil {
43 return 0, nil
44 }
45 i := len(dAtA)
46 _ = i
47 var l int
48 _ = l
49 if m.unknownFields != nil {
50 i -= len(m.unknownFields)
51 copy(dAtA[i:], m.unknownFields)
52 }
53 if m.DisallowIsError != nil {
54 size, err := (*wrapperspb.BoolValue)(m.DisallowIsError).MarshalToSizedBufferVTStrict(dAtA[:i])
55 if err != nil {
56 return 0, err
57 }
58 i -= size
59 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
60 i--
61 dAtA[i] = 0x3a
62 }
63 if m.DisallowExpression != nil {
64 if vtmsg, ok := interface{}(m.DisallowExpression).(interface {
65 MarshalToSizedBufferVTStrict([]byte) (int, error)
66 }); ok {
67 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
68 if err != nil {
69 return 0, err
70 }
71 i -= size
72 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
73 } else {
74 encoded, err := proto.Marshal(m.DisallowExpression)
75 if err != nil {
76 return 0, err
77 }
78 i -= len(encoded)
79 copy(dAtA[i:], encoded)
80 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
81 }
82 i--
83 dAtA[i] = 0x32
84 }
85 if m.AllowExpression != nil {
86 if vtmsg, ok := interface{}(m.AllowExpression).(interface {
87 MarshalToSizedBufferVTStrict([]byte) (int, error)
88 }); ok {
89 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
90 if err != nil {
91 return 0, err
92 }
93 i -= size
94 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
95 } else {
96 encoded, err := proto.Marshal(m.AllowExpression)
97 if err != nil {
98 return 0, err
99 }
100 i -= len(encoded)
101 copy(dAtA[i:], encoded)
102 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
103 }
104 i--
105 dAtA[i] = 0x2a
106 }
107 if m.DisallowAll != nil {
108 size, err := (*wrapperspb.BoolValue)(m.DisallowAll).MarshalToSizedBufferVTStrict(dAtA[:i])
109 if err != nil {
110 return 0, err
111 }
112 i -= size
113 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
114 i--
115 dAtA[i] = 0x22
116 }
117 if m.DisallowSystem != nil {
118 size, err := (*wrapperspb.BoolValue)(m.DisallowSystem).MarshalToSizedBufferVTStrict(dAtA[:i])
119 if err != nil {
120 return 0, err
121 }
122 i -= size
123 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
124 i--
125 dAtA[i] = 0x1a
126 }
127 if m.AllowEnvoy != nil {
128 size, err := (*wrapperspb.BoolValue)(m.AllowEnvoy).MarshalToSizedBufferVTStrict(dAtA[:i])
129 if err != nil {
130 return 0, err
131 }
132 i -= size
133 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
134 i--
135 dAtA[i] = 0x12
136 }
137 if m.AllowAllRouting != nil {
138 size, err := (*wrapperspb.BoolValue)(m.AllowAllRouting).MarshalToSizedBufferVTStrict(dAtA[:i])
139 if err != nil {
140 return 0, err
141 }
142 i -= size
143 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
144 i--
145 dAtA[i] = 0xa
146 }
147 return len(dAtA) - i, nil
148 }
149
150 func (m *HeaderMutation) MarshalVTStrict() (dAtA []byte, err error) {
151 if m == nil {
152 return nil, nil
153 }
154 size := m.SizeVT()
155 dAtA = make([]byte, size)
156 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
157 if err != nil {
158 return nil, err
159 }
160 return dAtA[:n], nil
161 }
162
163 func (m *HeaderMutation) MarshalToVTStrict(dAtA []byte) (int, error) {
164 size := m.SizeVT()
165 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
166 }
167
168 func (m *HeaderMutation) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
169 if m == nil {
170 return 0, nil
171 }
172 i := len(dAtA)
173 _ = i
174 var l int
175 _ = l
176 if m.unknownFields != nil {
177 i -= len(m.unknownFields)
178 copy(dAtA[i:], m.unknownFields)
179 }
180 if msg, ok := m.Action.(*HeaderMutation_Append); ok {
181 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
182 if err != nil {
183 return 0, err
184 }
185 i -= size
186 }
187 if msg, ok := m.Action.(*HeaderMutation_Remove); ok {
188 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
189 if err != nil {
190 return 0, err
191 }
192 i -= size
193 }
194 return len(dAtA) - i, nil
195 }
196
197 func (m *HeaderMutation_Remove) MarshalToVTStrict(dAtA []byte) (int, error) {
198 size := m.SizeVT()
199 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
200 }
201
202 func (m *HeaderMutation_Remove) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
203 i := len(dAtA)
204 i -= len(m.Remove)
205 copy(dAtA[i:], m.Remove)
206 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Remove)))
207 i--
208 dAtA[i] = 0xa
209 return len(dAtA) - i, nil
210 }
211 func (m *HeaderMutation_Append) MarshalToVTStrict(dAtA []byte) (int, error) {
212 size := m.SizeVT()
213 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
214 }
215
216 func (m *HeaderMutation_Append) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
217 i := len(dAtA)
218 if m.Append != nil {
219 if vtmsg, ok := interface{}(m.Append).(interface {
220 MarshalToSizedBufferVTStrict([]byte) (int, error)
221 }); ok {
222 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
223 if err != nil {
224 return 0, err
225 }
226 i -= size
227 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
228 } else {
229 encoded, err := proto.Marshal(m.Append)
230 if err != nil {
231 return 0, err
232 }
233 i -= len(encoded)
234 copy(dAtA[i:], encoded)
235 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
236 }
237 i--
238 dAtA[i] = 0x12
239 } else {
240 i = protohelpers.EncodeVarint(dAtA, i, 0)
241 i--
242 dAtA[i] = 0x12
243 }
244 return len(dAtA) - i, nil
245 }
246 func (m *HeaderMutationRules) SizeVT() (n int) {
247 if m == nil {
248 return 0
249 }
250 var l int
251 _ = l
252 if m.AllowAllRouting != nil {
253 l = (*wrapperspb.BoolValue)(m.AllowAllRouting).SizeVT()
254 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
255 }
256 if m.AllowEnvoy != nil {
257 l = (*wrapperspb.BoolValue)(m.AllowEnvoy).SizeVT()
258 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
259 }
260 if m.DisallowSystem != nil {
261 l = (*wrapperspb.BoolValue)(m.DisallowSystem).SizeVT()
262 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
263 }
264 if m.DisallowAll != nil {
265 l = (*wrapperspb.BoolValue)(m.DisallowAll).SizeVT()
266 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
267 }
268 if m.AllowExpression != nil {
269 if size, ok := interface{}(m.AllowExpression).(interface {
270 SizeVT() int
271 }); ok {
272 l = size.SizeVT()
273 } else {
274 l = proto.Size(m.AllowExpression)
275 }
276 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
277 }
278 if m.DisallowExpression != nil {
279 if size, ok := interface{}(m.DisallowExpression).(interface {
280 SizeVT() int
281 }); ok {
282 l = size.SizeVT()
283 } else {
284 l = proto.Size(m.DisallowExpression)
285 }
286 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
287 }
288 if m.DisallowIsError != nil {
289 l = (*wrapperspb.BoolValue)(m.DisallowIsError).SizeVT()
290 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
291 }
292 n += len(m.unknownFields)
293 return n
294 }
295
296 func (m *HeaderMutation) SizeVT() (n int) {
297 if m == nil {
298 return 0
299 }
300 var l int
301 _ = l
302 if vtmsg, ok := m.Action.(interface{ SizeVT() int }); ok {
303 n += vtmsg.SizeVT()
304 }
305 n += len(m.unknownFields)
306 return n
307 }
308
309 func (m *HeaderMutation_Remove) SizeVT() (n int) {
310 if m == nil {
311 return 0
312 }
313 var l int
314 _ = l
315 l = len(m.Remove)
316 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
317 return n
318 }
319 func (m *HeaderMutation_Append) SizeVT() (n int) {
320 if m == nil {
321 return 0
322 }
323 var l int
324 _ = l
325 if m.Append != nil {
326 if size, ok := interface{}(m.Append).(interface {
327 SizeVT() int
328 }); ok {
329 l = size.SizeVT()
330 } else {
331 l = proto.Size(m.Append)
332 }
333 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
334 } else {
335 n += 2
336 }
337 return n
338 }