| 1 |
//go:build vtprotobuf |
| 2 |
// +build vtprotobuf |
| 3 |
|
| 4 |
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 5 |
// source: envoy/config/grpc_credential/v2alpha/file_based_metadata.proto |
| 6 |
|
| 7 |
package v2alpha |
| 8 |
|
| 9 |
import ( |
| 10 |
protohelpers "github.com/planetscale/vtprotobuf/protohelpers" |
| 11 |
proto "google.golang.org/protobuf/proto" |
| 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 *FileBasedMetadataConfig) 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 *FileBasedMetadataConfig) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 36 |
size := m.SizeVT() |
| 37 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 38 |
} |
| 39 |
|
| 40 |
func (m *FileBasedMetadataConfig) 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 len(m.HeaderPrefix) > 0 { |
| 53 |
i -= len(m.HeaderPrefix) |
| 54 |
copy(dAtA[i:], m.HeaderPrefix) |
| 55 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.HeaderPrefix))) |
| 56 |
i-- |
| 57 |
dAtA[i] = 0x1a |
| 58 |
} |
| 59 |
if len(m.HeaderKey) > 0 { |
| 60 |
i -= len(m.HeaderKey) |
| 61 |
copy(dAtA[i:], m.HeaderKey) |
| 62 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.HeaderKey))) |
| 63 |
i-- |
| 64 |
dAtA[i] = 0x12 |
| 65 |
} |
| 66 |
if m.SecretData != nil { |
| 67 |
if vtmsg, ok := interface{}(m.SecretData).(interface { |
| 68 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 69 |
}); ok { |
| 70 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 71 |
if err != nil { |
| 72 |
return 0, err |
| 73 |
} |
| 74 |
i -= size |
| 75 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 76 |
} else { |
| 77 |
encoded, err := proto.Marshal(m.SecretData) |
| 78 |
if err != nil { |
| 79 |
return 0, err |
| 80 |
} |
| 81 |
i -= len(encoded) |
| 82 |
copy(dAtA[i:], encoded) |
| 83 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 84 |
} |
| 85 |
i-- |
| 86 |
dAtA[i] = 0xa |
| 87 |
} |
| 88 |
return len(dAtA) - i, nil |
| 89 |
} |
| 90 |
|
| 91 |
func (m *FileBasedMetadataConfig) SizeVT() (n int) { |
| 92 |
if m == nil { |
| 93 |
return 0 |
| 94 |
} |
| 95 |
var l int |
| 96 |
_ = l |
| 97 |
if m.SecretData != nil { |
| 98 |
if size, ok := interface{}(m.SecretData).(interface { |
| 99 |
SizeVT() int |
| 100 |
}); ok { |
| 101 |
l = size.SizeVT() |
| 102 |
} else { |
| 103 |
l = proto.Size(m.SecretData) |
| 104 |
} |
| 105 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 106 |
} |
| 107 |
l = len(m.HeaderKey) |
| 108 |
if l > 0 { |
| 109 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 110 |
} |
| 111 |
l = len(m.HeaderPrefix) |
| 112 |
if l > 0 { |
| 113 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 114 |
} |
| 115 |
n += len(m.unknownFields) |
| 116 |
return n |
| 117 |
} |