Debian Codegraph @

envoy/config/trace/v2alpha/xray_vtproto.pb.go

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