| 1 |
//go:build vtprotobuf |
| 2 |
// +build vtprotobuf |
| 3 |
|
| 4 |
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 5 |
// source: envoy/config/cluster/v3/circuit_breaker.proto |
| 6 |
|
| 7 |
package clusterv3 |
| 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 *CircuitBreakers_Thresholds_RetryBudget) 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 *CircuitBreakers_Thresholds_RetryBudget) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 37 |
size := m.SizeVT() |
| 38 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 39 |
} |
| 40 |
|
| 41 |
func (m *CircuitBreakers_Thresholds_RetryBudget) 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.MinRetryConcurrency != nil { |
| 54 |
size, err := (*wrapperspb.UInt32Value)(m.MinRetryConcurrency).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] = 0x12 |
| 62 |
} |
| 63 |
if m.BudgetPercent != nil { |
| 64 |
if vtmsg, ok := interface{}(m.BudgetPercent).(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.BudgetPercent) |
| 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] = 0xa |
| 84 |
} |
| 85 |
return len(dAtA) - i, nil |
| 86 |
} |
| 87 |
|
| 88 |
func (m *CircuitBreakers_Thresholds) MarshalVTStrict() (dAtA []byte, err error) { |
| 89 |
if m == nil { |
| 90 |
return nil, nil |
| 91 |
} |
| 92 |
size := m.SizeVT() |
| 93 |
dAtA = make([]byte, size) |
| 94 |
n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 95 |
if err != nil { |
| 96 |
return nil, err |
| 97 |
} |
| 98 |
return dAtA[:n], nil |
| 99 |
} |
| 100 |
|
| 101 |
func (m *CircuitBreakers_Thresholds) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 102 |
size := m.SizeVT() |
| 103 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 104 |
} |
| 105 |
|
| 106 |
func (m *CircuitBreakers_Thresholds) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { |
| 107 |
if m == nil { |
| 108 |
return 0, nil |
| 109 |
} |
| 110 |
i := len(dAtA) |
| 111 |
_ = i |
| 112 |
var l int |
| 113 |
_ = l |
| 114 |
if m.unknownFields != nil { |
| 115 |
i -= len(m.unknownFields) |
| 116 |
copy(dAtA[i:], m.unknownFields) |
| 117 |
} |
| 118 |
if m.RetryBudget != nil { |
| 119 |
size, err := m.RetryBudget.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 120 |
if err != nil { |
| 121 |
return 0, err |
| 122 |
} |
| 123 |
i -= size |
| 124 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 125 |
i-- |
| 126 |
dAtA[i] = 0x42 |
| 127 |
} |
| 128 |
if m.MaxConnectionPools != nil { |
| 129 |
size, err := (*wrapperspb.UInt32Value)(m.MaxConnectionPools).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 130 |
if err != nil { |
| 131 |
return 0, err |
| 132 |
} |
| 133 |
i -= size |
| 134 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 135 |
i-- |
| 136 |
dAtA[i] = 0x3a |
| 137 |
} |
| 138 |
if m.TrackRemaining { |
| 139 |
i-- |
| 140 |
if m.TrackRemaining { |
| 141 |
dAtA[i] = 1 |
| 142 |
} else { |
| 143 |
dAtA[i] = 0 |
| 144 |
} |
| 145 |
i-- |
| 146 |
dAtA[i] = 0x30 |
| 147 |
} |
| 148 |
if m.MaxRetries != nil { |
| 149 |
size, err := (*wrapperspb.UInt32Value)(m.MaxRetries).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 150 |
if err != nil { |
| 151 |
return 0, err |
| 152 |
} |
| 153 |
i -= size |
| 154 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 155 |
i-- |
| 156 |
dAtA[i] = 0x2a |
| 157 |
} |
| 158 |
if m.MaxRequests != nil { |
| 159 |
size, err := (*wrapperspb.UInt32Value)(m.MaxRequests).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 160 |
if err != nil { |
| 161 |
return 0, err |
| 162 |
} |
| 163 |
i -= size |
| 164 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 165 |
i-- |
| 166 |
dAtA[i] = 0x22 |
| 167 |
} |
| 168 |
if m.MaxPendingRequests != nil { |
| 169 |
size, err := (*wrapperspb.UInt32Value)(m.MaxPendingRequests).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 170 |
if err != nil { |
| 171 |
return 0, err |
| 172 |
} |
| 173 |
i -= size |
| 174 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 175 |
i-- |
| 176 |
dAtA[i] = 0x1a |
| 177 |
} |
| 178 |
if m.MaxConnections != nil { |
| 179 |
size, err := (*wrapperspb.UInt32Value)(m.MaxConnections).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 180 |
if err != nil { |
| 181 |
return 0, err |
| 182 |
} |
| 183 |
i -= size |
| 184 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 185 |
i-- |
| 186 |
dAtA[i] = 0x12 |
| 187 |
} |
| 188 |
if m.Priority != 0 { |
| 189 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Priority)) |
| 190 |
i-- |
| 191 |
dAtA[i] = 0x8 |
| 192 |
} |
| 193 |
return len(dAtA) - i, nil |
| 194 |
} |
| 195 |
|
| 196 |
func (m *CircuitBreakers) MarshalVTStrict() (dAtA []byte, err error) { |
| 197 |
if m == nil { |
| 198 |
return nil, nil |
| 199 |
} |
| 200 |
size := m.SizeVT() |
| 201 |
dAtA = make([]byte, size) |
| 202 |
n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 203 |
if err != nil { |
| 204 |
return nil, err |
| 205 |
} |
| 206 |
return dAtA[:n], nil |
| 207 |
} |
| 208 |
|
| 209 |
func (m *CircuitBreakers) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 210 |
size := m.SizeVT() |
| 211 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 212 |
} |
| 213 |
|
| 214 |
func (m *CircuitBreakers) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { |
| 215 |
if m == nil { |
| 216 |
return 0, nil |
| 217 |
} |
| 218 |
i := len(dAtA) |
| 219 |
_ = i |
| 220 |
var l int |
| 221 |
_ = l |
| 222 |
if m.unknownFields != nil { |
| 223 |
i -= len(m.unknownFields) |
| 224 |
copy(dAtA[i:], m.unknownFields) |
| 225 |
} |
| 226 |
if len(m.PerHostThresholds) > 0 { |
| 227 |
for iNdEx := len(m.PerHostThresholds) - 1; iNdEx >= 0; iNdEx-- { |
| 228 |
size, err := m.PerHostThresholds[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 229 |
if err != nil { |
| 230 |
return 0, err |
| 231 |
} |
| 232 |
i -= size |
| 233 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 234 |
i-- |
| 235 |
dAtA[i] = 0x12 |
| 236 |
} |
| 237 |
} |
| 238 |
if len(m.Thresholds) > 0 { |
| 239 |
for iNdEx := len(m.Thresholds) - 1; iNdEx >= 0; iNdEx-- { |
| 240 |
size, err := m.Thresholds[iNdEx].MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 241 |
if err != nil { |
| 242 |
return 0, err |
| 243 |
} |
| 244 |
i -= size |
| 245 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 246 |
i-- |
| 247 |
dAtA[i] = 0xa |
| 248 |
} |
| 249 |
} |
| 250 |
return len(dAtA) - i, nil |
| 251 |
} |
| 252 |
|
| 253 |
func (m *CircuitBreakers_Thresholds_RetryBudget) SizeVT() (n int) { |
| 254 |
if m == nil { |
| 255 |
return 0 |
| 256 |
} |
| 257 |
var l int |
| 258 |
_ = l |
| 259 |
if m.BudgetPercent != nil { |
| 260 |
if size, ok := interface{}(m.BudgetPercent).(interface { |
| 261 |
SizeVT() int |
| 262 |
}); ok { |
| 263 |
l = size.SizeVT() |
| 264 |
} else { |
| 265 |
l = proto.Size(m.BudgetPercent) |
| 266 |
} |
| 267 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 268 |
} |
| 269 |
if m.MinRetryConcurrency != nil { |
| 270 |
l = (*wrapperspb.UInt32Value)(m.MinRetryConcurrency).SizeVT() |
| 271 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 272 |
} |
| 273 |
n += len(m.unknownFields) |
| 274 |
return n |
| 275 |
} |
| 276 |
|
| 277 |
func (m *CircuitBreakers_Thresholds) SizeVT() (n int) { |
| 278 |
if m == nil { |
| 279 |
return 0 |
| 280 |
} |
| 281 |
var l int |
| 282 |
_ = l |
| 283 |
if m.Priority != 0 { |
| 284 |
n += 1 + protohelpers.SizeOfVarint(uint64(m.Priority)) |
| 285 |
} |
| 286 |
if m.MaxConnections != nil { |
| 287 |
l = (*wrapperspb.UInt32Value)(m.MaxConnections).SizeVT() |
| 288 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 289 |
} |
| 290 |
if m.MaxPendingRequests != nil { |
| 291 |
l = (*wrapperspb.UInt32Value)(m.MaxPendingRequests).SizeVT() |
| 292 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 293 |
} |
| 294 |
if m.MaxRequests != nil { |
| 295 |
l = (*wrapperspb.UInt32Value)(m.MaxRequests).SizeVT() |
| 296 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 297 |
} |
| 298 |
if m.MaxRetries != nil { |
| 299 |
l = (*wrapperspb.UInt32Value)(m.MaxRetries).SizeVT() |
| 300 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 301 |
} |
| 302 |
if m.TrackRemaining { |
| 303 |
n += 2 |
| 304 |
} |
| 305 |
if m.MaxConnectionPools != nil { |
| 306 |
l = (*wrapperspb.UInt32Value)(m.MaxConnectionPools).SizeVT() |
| 307 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 308 |
} |
| 309 |
if m.RetryBudget != nil { |
| 310 |
l = m.RetryBudget.SizeVT() |
| 311 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 312 |
} |
| 313 |
n += len(m.unknownFields) |
| 314 |
return n |
| 315 |
} |
| 316 |
|
| 317 |
func (m *CircuitBreakers) SizeVT() (n int) { |
| 318 |
if m == nil { |
| 319 |
return 0 |
| 320 |
} |
| 321 |
var l int |
| 322 |
_ = l |
| 323 |
if len(m.Thresholds) > 0 { |
| 324 |
for _, e := range m.Thresholds { |
| 325 |
l = e.SizeVT() |
| 326 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 327 |
} |
| 328 |
} |
| 329 |
if len(m.PerHostThresholds) > 0 { |
| 330 |
for _, e := range m.PerHostThresholds { |
| 331 |
l = e.SizeVT() |
| 332 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 333 |
} |
| 334 |
} |
| 335 |
n += len(m.unknownFields) |
| 336 |
return n |
| 337 |
} |