Debian Codegraph @

envoy/extensions/transport_sockets/proxy_protocol/v3/upstream_proxy_protocol_vtproto.pb.go

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