| 1 |
//go:build vtprotobuf |
| 2 |
// +build vtprotobuf |
| 3 |
|
| 4 |
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 5 |
// source: envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto |
| 6 |
|
| 7 |
package dynamic_forward_proxyv3 |
| 8 |
|
| 9 |
import ( |
| 10 |
protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 11 |
durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" |
| 12 |
wrapperspb "github.com/planetscale/vtprotobuf/types/known/wrapperspb" |
| 13 |
proto "google.golang.org/protobuf/proto" |
| 14 |
protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 15 |
) |
| 16 |
|
| 17 |
const ( |
| 18 |
// Verify that this generated code is sufficiently up-to-date. |
| 19 |
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 20 |
// Verify that runtime/protoimpl is sufficiently up-to-date. |
| 21 |
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 22 |
) |
| 23 |
|
| 24 |
func (m *DnsCacheCircuitBreakers) MarshalVTStrict() (dAtA []byte, err error) { |
| 25 |
if m == nil { |
| 26 |
return nil, nil |
| 27 |
} |
| 28 |
size := m.SizeVT() |
| 29 |
dAtA = make([]byte, size) |
| 30 |
n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 31 |
if err != nil { |
| 32 |
return nil, err |
| 33 |
} |
| 34 |
return dAtA[:n], nil |
| 35 |
} |
| 36 |
|
| 37 |
func (m *DnsCacheCircuitBreakers) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 38 |
size := m.SizeVT() |
| 39 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 40 |
} |
| 41 |
|
| 42 |
func (m *DnsCacheCircuitBreakers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { |
| 43 |
if m == nil { |
| 44 |
return 0, nil |
| 45 |
} |
| 46 |
i := len(dAtA) |
| 47 |
_ = i |
| 48 |
var l int |
| 49 |
_ = l |
| 50 |
if m.unknownFields != nil { |
| 51 |
i -= len(m.unknownFields) |
| 52 |
copy(dAtA[i:], m.unknownFields) |
| 53 |
} |
| 54 |
if m.MaxPendingRequests != nil { |
| 55 |
size, err := (*wrapperspb.UInt32Value)(m.MaxPendingRequests).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 56 |
if err != nil { |
| 57 |
return 0, err |
| 58 |
} |
| 59 |
i -= size |
| 60 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 61 |
i-- |
| 62 |
dAtA[i] = 0xa |
| 63 |
} |
| 64 |
return len(dAtA) - i, nil |
| 65 |
} |
| 66 |
|
| 67 |
func (m *DnsCacheConfig) MarshalVTStrict() (dAtA []byte, err error) { |
| 68 |
if m == nil { |
| 69 |
return nil, nil |
| 70 |
} |
| 71 |
size := m.SizeVT() |
| 72 |
dAtA = make([]byte, size) |
| 73 |
n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 74 |
if err != nil { |
| 75 |
return nil, err |
| 76 |
} |
| 77 |
return dAtA[:n], nil |
| 78 |
} |
| 79 |
|
| 80 |
func (m *DnsCacheConfig) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 81 |
size := m.SizeVT() |
| 82 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 83 |
} |
| 84 |
|
| 85 |
func (m *DnsCacheConfig) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { |
| 86 |
if m == nil { |
| 87 |
return 0, nil |
| 88 |
} |
| 89 |
i := len(dAtA) |
| 90 |
_ = i |
| 91 |
var l int |
| 92 |
_ = l |
| 93 |
if m.unknownFields != nil { |
| 94 |
i -= len(m.unknownFields) |
| 95 |
copy(dAtA[i:], m.unknownFields) |
| 96 |
} |
| 97 |
if m.DnsMinRefreshRate != nil { |
| 98 |
size, err := (*durationpb.Duration)(m.DnsMinRefreshRate).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 99 |
if err != nil { |
| 100 |
return 0, err |
| 101 |
} |
| 102 |
i -= size |
| 103 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 104 |
i-- |
| 105 |
dAtA[i] = 0x72 |
| 106 |
} |
| 107 |
if m.KeyValueConfig != nil { |
| 108 |
if vtmsg, ok := interface{}(m.KeyValueConfig).(interface { |
| 109 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 110 |
}); ok { |
| 111 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 112 |
if err != nil { |
| 113 |
return 0, err |
| 114 |
} |
| 115 |
i -= size |
| 116 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 117 |
} else { |
| 118 |
encoded, err := proto.Marshal(m.KeyValueConfig) |
| 119 |
if err != nil { |
| 120 |
return 0, err |
| 121 |
} |
| 122 |
i -= len(encoded) |
| 123 |
copy(dAtA[i:], encoded) |
| 124 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 125 |
} |
| 126 |
i-- |
| 127 |
dAtA[i] = 0x6a |
| 128 |
} |
| 129 |
if m.TypedDnsResolverConfig != nil { |
| 130 |
if vtmsg, ok := interface{}(m.TypedDnsResolverConfig).(interface { |
| 131 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 132 |
}); ok { |
| 133 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 134 |
if err != nil { |
| 135 |
return 0, err |
| 136 |
} |
| 137 |
i -= size |
| 138 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 139 |
} else { |
| 140 |
encoded, err := proto.Marshal(m.TypedDnsResolverConfig) |
| 141 |
if err != nil { |
| 142 |
return 0, err |
| 143 |
} |
| 144 |
i -= len(encoded) |
| 145 |
copy(dAtA[i:], encoded) |
| 146 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 147 |
} |
| 148 |
i-- |
| 149 |
dAtA[i] = 0x62 |
| 150 |
} |
| 151 |
if m.DnsQueryTimeout != nil { |
| 152 |
size, err := (*durationpb.Duration)(m.DnsQueryTimeout).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 153 |
if err != nil { |
| 154 |
return 0, err |
| 155 |
} |
| 156 |
i -= size |
| 157 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 158 |
i-- |
| 159 |
dAtA[i] = 0x5a |
| 160 |
} |
| 161 |
if len(m.PreresolveHostnames) > 0 { |
| 162 |
for iNdEx := len(m.PreresolveHostnames) - 1; iNdEx >= 0; iNdEx-- { |
| 163 |
if vtmsg, ok := interface{}(m.PreresolveHostnames[iNdEx]).(interface { |
| 164 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 165 |
}); ok { |
| 166 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 167 |
if err != nil { |
| 168 |
return 0, err |
| 169 |
} |
| 170 |
i -= size |
| 171 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 172 |
} else { |
| 173 |
encoded, err := proto.Marshal(m.PreresolveHostnames[iNdEx]) |
| 174 |
if err != nil { |
| 175 |
return 0, err |
| 176 |
} |
| 177 |
i -= len(encoded) |
| 178 |
copy(dAtA[i:], encoded) |
| 179 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 180 |
} |
| 181 |
i-- |
| 182 |
dAtA[i] = 0x52 |
| 183 |
} |
| 184 |
} |
| 185 |
if m.DnsResolutionConfig != nil { |
| 186 |
if vtmsg, ok := interface{}(m.DnsResolutionConfig).(interface { |
| 187 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 188 |
}); ok { |
| 189 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 190 |
if err != nil { |
| 191 |
return 0, err |
| 192 |
} |
| 193 |
i -= size |
| 194 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 195 |
} else { |
| 196 |
encoded, err := proto.Marshal(m.DnsResolutionConfig) |
| 197 |
if err != nil { |
| 198 |
return 0, err |
| 199 |
} |
| 200 |
i -= len(encoded) |
| 201 |
copy(dAtA[i:], encoded) |
| 202 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 203 |
} |
| 204 |
i-- |
| 205 |
dAtA[i] = 0x4a |
| 206 |
} |
| 207 |
if m.UseTcpForDnsLookups { |
| 208 |
i-- |
| 209 |
if m.UseTcpForDnsLookups { |
| 210 |
dAtA[i] = 1 |
| 211 |
} else { |
| 212 |
dAtA[i] = 0 |
| 213 |
} |
| 214 |
i-- |
| 215 |
dAtA[i] = 0x40 |
| 216 |
} |
| 217 |
if m.DnsCacheCircuitBreaker != nil { |
| 218 |
size, err := m.DnsCacheCircuitBreaker.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 219 |
if err != nil { |
| 220 |
return 0, err |
| 221 |
} |
| 222 |
i -= size |
| 223 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 224 |
i-- |
| 225 |
dAtA[i] = 0x3a |
| 226 |
} |
| 227 |
if m.DnsFailureRefreshRate != nil { |
| 228 |
if vtmsg, ok := interface{}(m.DnsFailureRefreshRate).(interface { |
| 229 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 230 |
}); ok { |
| 231 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 232 |
if err != nil { |
| 233 |
return 0, err |
| 234 |
} |
| 235 |
i -= size |
| 236 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 237 |
} else { |
| 238 |
encoded, err := proto.Marshal(m.DnsFailureRefreshRate) |
| 239 |
if err != nil { |
| 240 |
return 0, err |
| 241 |
} |
| 242 |
i -= len(encoded) |
| 243 |
copy(dAtA[i:], encoded) |
| 244 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 245 |
} |
| 246 |
i-- |
| 247 |
dAtA[i] = 0x32 |
| 248 |
} |
| 249 |
if m.MaxHosts != nil { |
| 250 |
size, err := (*wrapperspb.UInt32Value)(m.MaxHosts).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 251 |
if err != nil { |
| 252 |
return 0, err |
| 253 |
} |
| 254 |
i -= size |
| 255 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 256 |
i-- |
| 257 |
dAtA[i] = 0x2a |
| 258 |
} |
| 259 |
if m.HostTtl != nil { |
| 260 |
size, err := (*durationpb.Duration)(m.HostTtl).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 261 |
if err != nil { |
| 262 |
return 0, err |
| 263 |
} |
| 264 |
i -= size |
| 265 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 266 |
i-- |
| 267 |
dAtA[i] = 0x22 |
| 268 |
} |
| 269 |
if m.DnsRefreshRate != nil { |
| 270 |
size, err := (*durationpb.Duration)(m.DnsRefreshRate).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 271 |
if err != nil { |
| 272 |
return 0, err |
| 273 |
} |
| 274 |
i -= size |
| 275 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 276 |
i-- |
| 277 |
dAtA[i] = 0x1a |
| 278 |
} |
| 279 |
if m.DnsLookupFamily != 0 { |
| 280 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DnsLookupFamily)) |
| 281 |
i-- |
| 282 |
dAtA[i] = 0x10 |
| 283 |
} |
| 284 |
if len(m.Name) > 0 { |
| 285 |
i -= len(m.Name) |
| 286 |
copy(dAtA[i:], m.Name) |
| 287 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) |
| 288 |
i-- |
| 289 |
dAtA[i] = 0xa |
| 290 |
} |
| 291 |
return len(dAtA) - i, nil |
| 292 |
} |
| 293 |
|
| 294 |
func (m *DnsCacheCircuitBreakers) SizeVT() (n int) { |
| 295 |
if m == nil { |
| 296 |
return 0 |
| 297 |
} |
| 298 |
var l int |
| 299 |
_ = l |
| 300 |
if m.MaxPendingRequests != nil { |
| 301 |
l = (*wrapperspb.UInt32Value)(m.MaxPendingRequests).SizeVT() |
| 302 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 303 |
} |
| 304 |
n += len(m.unknownFields) |
| 305 |
return n |
| 306 |
} |
| 307 |
|
| 308 |
func (m *DnsCacheConfig) SizeVT() (n int) { |
| 309 |
if m == nil { |
| 310 |
return 0 |
| 311 |
} |
| 312 |
var l int |
| 313 |
_ = l |
| 314 |
l = len(m.Name) |
| 315 |
if l > 0 { |
| 316 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 317 |
} |
| 318 |
if m.DnsLookupFamily != 0 { |
| 319 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.DnsLookupFamily)) |
| 320 |
} |
| 321 |
if m.DnsRefreshRate != nil { |
| 322 |
l = (*durationpb.Duration)(m.DnsRefreshRate).SizeVT() |
| 323 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 324 |
} |
| 325 |
if m.HostTtl != nil { |
| 326 |
l = (*durationpb.Duration)(m.HostTtl).SizeVT() |
| 327 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 328 |
} |
| 329 |
if m.MaxHosts != nil { |
| 330 |
l = (*wrapperspb.UInt32Value)(m.MaxHosts).SizeVT() |
| 331 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 332 |
} |
| 333 |
if m.DnsFailureRefreshRate != nil { |
| 334 |
if size, ok := interface{}(m.DnsFailureRefreshRate).(interface { |
| 335 |
SizeVT() int |
| 336 |
}); ok { |
| 337 |
l = size.SizeVT() |
| 338 |
} else { |
| 339 |
l = proto.Size(m.DnsFailureRefreshRate) |
| 340 |
} |
| 341 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 342 |
} |
| 343 |
if m.DnsCacheCircuitBreaker != nil { |
| 344 |
l = m.DnsCacheCircuitBreaker.SizeVT() |
| 345 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 346 |
} |
| 347 |
if m.UseTcpForDnsLookups { |
| 348 |
n += 2 |
| 349 |
} |
| 350 |
if m.DnsResolutionConfig != nil { |
| 351 |
if size, ok := interface{}(m.DnsResolutionConfig).(interface { |
| 352 |
SizeVT() int |
| 353 |
}); ok { |
| 354 |
l = size.SizeVT() |
| 355 |
} else { |
| 356 |
l = proto.Size(m.DnsResolutionConfig) |
| 357 |
} |
| 358 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 359 |
} |
| 360 |
if len(m.PreresolveHostnames) > 0 { |
| 361 |
for _, e := range m.PreresolveHostnames { |
| 362 |
if size, ok := interface{}(e).(interface { |
| 363 |
SizeVT() int |
| 364 |
}); ok { |
| 365 |
l = size.SizeVT() |
| 366 |
} else { |
| 367 |
l = proto.Size(e) |
| 368 |
} |
| 369 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 370 |
} |
| 371 |
} |
| 372 |
if m.DnsQueryTimeout != nil { |
| 373 |
l = (*durationpb.Duration)(m.DnsQueryTimeout).SizeVT() |
| 374 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 375 |
} |
| 376 |
if m.TypedDnsResolverConfig != nil { |
| 377 |
if size, ok := interface{}(m.TypedDnsResolverConfig).(interface { |
| 378 |
SizeVT() int |
| 379 |
}); ok { |
| 380 |
l = size.SizeVT() |
| 381 |
} else { |
| 382 |
l = proto.Size(m.TypedDnsResolverConfig) |
| 383 |
} |
| 384 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 385 |
} |
| 386 |
if m.KeyValueConfig != nil { |
| 387 |
if size, ok := interface{}(m.KeyValueConfig).(interface { |
| 388 |
SizeVT() int |
| 389 |
}); ok { |
| 390 |
l = size.SizeVT() |
| 391 |
} else { |
| 392 |
l = proto.Size(m.KeyValueConfig) |
| 393 |
} |
| 394 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 395 |
} |
| 396 |
if m.DnsMinRefreshRate != nil { |
| 397 |
l = (*durationpb.Duration)(m.DnsMinRefreshRate).SizeVT() |
| 398 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 399 |
} |
| 400 |
n += len(m.unknownFields) |
| 401 |
return n |
| 402 |
} |