Debian Codegraph @

envoy/config/core/v3/substitution_format_string_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/core/v3/substitution_format_string.proto
6
7 package corev3
8
9 import (
10 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
11 structpb "github.com/planetscale/vtprotobuf/types/known/structpb"
12 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
13 )
14
15 const (
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
22 func (m *JsonFormatOptions) MarshalVTStrict() (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.MarshalToSizedBufferVTStrict(dAtA[:size])
29 if err != nil {
30 return nil, err
31 }
32 return dAtA[:n], nil
33 }
34
35 func (m *JsonFormatOptions) MarshalToVTStrict(dAtA []byte) (int, error) {
36 size := m.SizeVT()
37 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
38 }
39
40 func (m *JsonFormatOptions) MarshalToSizedBufferVTStrict(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.SortProperties {
53 i--
54 if m.SortProperties {
55 dAtA[i] = 1
56 } else {
57 dAtA[i] = 0
58 }
59 i--
60 dAtA[i] = 0x8
61 }
62 return len(dAtA) - i, nil
63 }
64
65 func (m *SubstitutionFormatString) MarshalVTStrict() (dAtA []byte, err error) {
66 if m == nil {
67 return nil, nil
68 }
69 size := m.SizeVT()
70 dAtA = make([]byte, size)
71 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
72 if err != nil {
73 return nil, err
74 }
75 return dAtA[:n], nil
76 }
77
78 func (m *SubstitutionFormatString) MarshalToVTStrict(dAtA []byte) (int, error) {
79 size := m.SizeVT()
80 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
81 }
82
83 func (m *SubstitutionFormatString) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
84 if m == nil {
85 return 0, nil
86 }
87 i := len(dAtA)
88 _ = i
89 var l int
90 _ = l
91 if m.unknownFields != nil {
92 i -= len(m.unknownFields)
93 copy(dAtA[i:], m.unknownFields)
94 }
95 if m.JsonFormatOptions != nil {
96 size, err := m.JsonFormatOptions.MarshalToSizedBufferVTStrict(dAtA[:i])
97 if err != nil {
98 return 0, err
99 }
100 i -= size
101 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
102 i--
103 dAtA[i] = 0x3a
104 }
105 if len(m.Formatters) > 0 {
106 for iNdEx := len(m.Formatters) - 1; iNdEx >= 0; iNdEx-- {
107 size, err := m.Formatters[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i])
108 if err != nil {
109 return 0, err
110 }
111 i -= size
112 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
113 i--
114 dAtA[i] = 0x32
115 }
116 }
117 if msg, ok := m.Format.(*SubstitutionFormatString_TextFormatSource); ok {
118 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
119 if err != nil {
120 return 0, err
121 }
122 i -= size
123 }
124 if len(m.ContentType) > 0 {
125 i -= len(m.ContentType)
126 copy(dAtA[i:], m.ContentType)
127 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ContentType)))
128 i--
129 dAtA[i] = 0x22
130 }
131 if m.OmitEmptyValues {
132 i--
133 if m.OmitEmptyValues {
134 dAtA[i] = 1
135 } else {
136 dAtA[i] = 0
137 }
138 i--
139 dAtA[i] = 0x18
140 }
141 if msg, ok := m.Format.(*SubstitutionFormatString_JsonFormat); ok {
142 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
143 if err != nil {
144 return 0, err
145 }
146 i -= size
147 }
148 if msg, ok := m.Format.(*SubstitutionFormatString_TextFormat); ok {
149 size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i])
150 if err != nil {
151 return 0, err
152 }
153 i -= size
154 }
155 return len(dAtA) - i, nil
156 }
157
158 func (m *SubstitutionFormatString_TextFormat) MarshalToVTStrict(dAtA []byte) (int, error) {
159 size := m.SizeVT()
160 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
161 }
162
163 func (m *SubstitutionFormatString_TextFormat) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
164 i := len(dAtA)
165 i -= len(m.TextFormat)
166 copy(dAtA[i:], m.TextFormat)
167 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TextFormat)))
168 i--
169 dAtA[i] = 0xa
170 return len(dAtA) - i, nil
171 }
172 func (m *SubstitutionFormatString_JsonFormat) MarshalToVTStrict(dAtA []byte) (int, error) {
173 size := m.SizeVT()
174 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
175 }
176
177 func (m *SubstitutionFormatString_JsonFormat) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
178 i := len(dAtA)
179 if m.JsonFormat != nil {
180 size, err := (*structpb.Struct)(m.JsonFormat).MarshalToSizedBufferVTStrict(dAtA[:i])
181 if err != nil {
182 return 0, err
183 }
184 i -= size
185 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
186 i--
187 dAtA[i] = 0x12
188 } else {
189 i = protohelpers.EncodeVarint(dAtA, i, 0)
190 i--
191 dAtA[i] = 0x12
192 }
193 return len(dAtA) - i, nil
194 }
195 func (m *SubstitutionFormatString_TextFormatSource) MarshalToVTStrict(dAtA []byte) (int, error) {
196 size := m.SizeVT()
197 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
198 }
199
200 func (m *SubstitutionFormatString_TextFormatSource) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
201 i := len(dAtA)
202 if m.TextFormatSource != nil {
203 size, err := m.TextFormatSource.MarshalToSizedBufferVTStrict(dAtA[:i])
204 if err != nil {
205 return 0, err
206 }
207 i -= size
208 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
209 i--
210 dAtA[i] = 0x2a
211 } else {
212 i = protohelpers.EncodeVarint(dAtA, i, 0)
213 i--
214 dAtA[i] = 0x2a
215 }
216 return len(dAtA) - i, nil
217 }
218 func (m *JsonFormatOptions) SizeVT() (n int) {
219 if m == nil {
220 return 0
221 }
222 var l int
223 _ = l
224 if m.SortProperties {
225 n += 2
226 }
227 n += len(m.unknownFields)
228 return n
229 }
230
231 func (m *SubstitutionFormatString) SizeVT() (n int) {
232 if m == nil {
233 return 0
234 }
235 var l int
236 _ = l
237 if vtmsg, ok := m.Format.(interface{ SizeVT() int }); ok {
238 n += vtmsg.SizeVT()
239 }
240 if m.OmitEmptyValues {
241 n += 2
242 }
243 l = len(m.ContentType)
244 if l > 0 {
245 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
246 }
247 if len(m.Formatters) > 0 {
248 for _, e := range m.Formatters {
249 l = e.SizeVT()
250 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
251 }
252 }
253 if m.JsonFormatOptions != nil {
254 l = m.JsonFormatOptions.SizeVT()
255 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
256 }
257 n += len(m.unknownFields)
258 return n
259 }
260
261 func (m *SubstitutionFormatString_TextFormat) SizeVT() (n int) {
262 if m == nil {
263 return 0
264 }
265 var l int
266 _ = l
267 l = len(m.TextFormat)
268 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
269 return n
270 }
271 func (m *SubstitutionFormatString_JsonFormat) SizeVT() (n int) {
272 if m == nil {
273 return 0
274 }
275 var l int
276 _ = l
277 if m.JsonFormat != nil {
278 l = (*structpb.Struct)(m.JsonFormat).SizeVT()
279 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
280 } else {
281 n += 2
282 }
283 return n
284 }
285 func (m *SubstitutionFormatString_TextFormatSource) SizeVT() (n int) {
286 if m == nil {
287 return 0
288 }
289 var l int
290 _ = l
291 if m.TextFormatSource != nil {
292 l = m.TextFormatSource.SizeVT()
293 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
294 } else {
295 n += 2
296 }
297 return n
298 }