| 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/backoff.proto |
| 6 |
|
| 7 |
package corev3 |
| 8 |
|
| 9 |
import ( |
| 10 |
protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 11 |
durationpb "github.com/planetscale/vtprotobuf/types/known/durationpb" |
| 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 *BackoffStrategy) 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 *BackoffStrategy) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 36 |
size := m.SizeVT() |
| 37 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 38 |
} |
| 39 |
|
| 40 |
func (m *BackoffStrategy) 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.MaxInterval != nil { |
| 53 |
size, err := (*durationpb.Duration)(m.MaxInterval).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 54 |
if err != nil { |
| 55 |
return 0, err |
| 56 |
} |
| 57 |
i -= size |
| 58 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 59 |
i-- |
| 60 |
dAtA[i] = 0x12 |
| 61 |
} |
| 62 |
if m.BaseInterval != nil { |
| 63 |
size, err := (*durationpb.Duration)(m.BaseInterval).MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 64 |
if err != nil { |
| 65 |
return 0, err |
| 66 |
} |
| 67 |
i -= size |
| 68 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 69 |
i-- |
| 70 |
dAtA[i] = 0xa |
| 71 |
} |
| 72 |
return len(dAtA) - i, nil |
| 73 |
} |
| 74 |
|
| 75 |
func (m *BackoffStrategy) SizeVT() (n int) { |
| 76 |
if m == nil { |
| 77 |
return 0 |
| 78 |
} |
| 79 |
var l int |
| 80 |
_ = l |
| 81 |
if m.BaseInterval != nil { |
| 82 |
l = (*durationpb.Duration)(m.BaseInterval).SizeVT() |
| 83 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 84 |
} |
| 85 |
if m.MaxInterval != nil { |
| 86 |
l = (*durationpb.Duration)(m.MaxInterval).SizeVT() |
| 87 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 88 |
} |
| 89 |
n += len(m.unknownFields) |
| 90 |
return n |
| 91 |
} |