| 1 |
//go:build vtprotobuf |
| 2 |
// +build vtprotobuf |
| 3 |
|
| 4 |
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. |
| 5 |
// source: envoy/extensions/stat_sinks/graphite_statsd/v3/graphite_statsd.proto |
| 6 |
|
| 7 |
package graphite_statsdv3 |
| 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 *GraphiteStatsdSink) 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 *GraphiteStatsdSink) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 37 |
size := m.SizeVT() |
| 38 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 39 |
} |
| 40 |
|
| 41 |
func (m *GraphiteStatsdSink) 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.MaxBytesPerDatagram != nil { |
| 54 |
size, err := (*wrapperspb.UInt64Value)(m.MaxBytesPerDatagram).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] = 0x22 |
| 62 |
} |
| 63 |
if len(m.Prefix) > 0 { |
| 64 |
i -= len(m.Prefix) |
| 65 |
copy(dAtA[i:], m.Prefix) |
| 66 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Prefix))) |
| 67 |
i-- |
| 68 |
dAtA[i] = 0x1a |
| 69 |
} |
| 70 |
if msg, ok := m.StatsdSpecifier.(*GraphiteStatsdSink_Address); ok { |
| 71 |
size, err := msg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 72 |
if err != nil { |
| 73 |
return 0, err |
| 74 |
} |
| 75 |
i -= size |
| 76 |
} |
| 77 |
return len(dAtA) - i, nil |
| 78 |
} |
| 79 |
|
| 80 |
func (m *GraphiteStatsdSink_Address) MarshalToVTStrict(dAtA []byte) (int, error) { |
| 81 |
size := m.SizeVT() |
| 82 |
return m.MarshalToSizedBufferVTStrict(dAtA[:size]) |
| 83 |
} |
| 84 |
|
| 85 |
func (m *GraphiteStatsdSink_Address) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { |
| 86 |
i := len(dAtA) |
| 87 |
if m.Address != nil { |
| 88 |
if vtmsg, ok := interface{}(m.Address).(interface { |
| 89 |
MarshalToSizedBufferVTStrict([]byte) (int, error) |
| 90 |
}); ok { |
| 91 |
size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) |
| 92 |
if err != nil { |
| 93 |
return 0, err |
| 94 |
} |
| 95 |
i -= size |
| 96 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) |
| 97 |
} else { |
| 98 |
encoded, err := proto.Marshal(m.Address) |
| 99 |
if err != nil { |
| 100 |
return 0, err |
| 101 |
} |
| 102 |
i -= len(encoded) |
| 103 |
copy(dAtA[i:], encoded) |
| 104 |
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) |
| 105 |
} |
| 106 |
i-- |
| 107 |
dAtA[i] = 0xa |
| 108 |
} else { |
| 109 |
i = protohelpers.EncodeVarint(dAtA, i, 0) |
| 110 |
i-- |
| 111 |
dAtA[i] = 0xa |
| 112 |
} |
| 113 |
return len(dAtA) - i, nil |
| 114 |
} |
| 115 |
func (m *GraphiteStatsdSink) SizeVT() (n int) { |
| 116 |
if m == nil { |
| 117 |
return 0 |
| 118 |
} |
| 119 |
var l int |
| 120 |
_ = l |
| 121 |
if vtmsg, ok := m.StatsdSpecifier.(interface{ SizeVT() int }); ok { |
| 122 |
n += vtmsg.SizeVT() |
| 123 |
} |
| 124 |
l = len(m.Prefix) |
| 125 |
if l > 0 { |
| 126 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 127 |
} |
| 128 |
if m.MaxBytesPerDatagram != nil { |
| 129 |
l = (*wrapperspb.UInt64Value)(m.MaxBytesPerDatagram).SizeVT() |
| 130 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 131 |
} |
| 132 |
n += len(m.unknownFields) |
| 133 |
return n |
| 134 |
} |
| 135 |
|
| 136 |
func (m *GraphiteStatsdSink_Address) SizeVT() (n int) { |
| 137 |
if m == nil { |
| 138 |
return 0 |
| 139 |
} |
| 140 |
var l int |
| 141 |
_ = l |
| 142 |
if m.Address != nil { |
| 143 |
if size, ok := interface{}(m.Address).(interface { |
| 144 |
SizeVT() int |
| 145 |
}); ok { |
| 146 |
l = size.SizeVT() |
| 147 |
} else { |
| 148 |
l = proto.Size(m.Address) |
| 149 |
} |
| 150 |
n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) |
| 151 |
} else { |
| 152 |
n += 2 |
| 153 |
} |
| 154 |
return n |
| 155 |
} |