Debian Codegraph @

envoy/extensions/router/cluster_specifiers/lua/v3/lua_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/extensions/router/cluster_specifiers/lua/v3/lua.proto
6
7 package luav3
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 *LuaConfig) 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 *LuaConfig) MarshalToVTStrict(dAtA []byte) (int, error) {
36 size := m.SizeVT()
37 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
38 }
39
40 func (m *LuaConfig) 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.DefaultCluster) > 0 {
53 i -= len(m.DefaultCluster)
54 copy(dAtA[i:], m.DefaultCluster)
55 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DefaultCluster)))
56 i--
57 dAtA[i] = 0x12
58 }
59 if m.SourceCode != nil {
60 if vtmsg, ok := interface{}(m.SourceCode).(interface {
61 MarshalToSizedBufferVTStrict([]byte) (int, error)
62 }); ok {
63 size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i])
64 if err != nil {
65 return 0, err
66 }
67 i -= size
68 i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
69 } else {
70 encoded, err := proto.Marshal(m.SourceCode)
71 if err != nil {
72 return 0, err
73 }
74 i -= len(encoded)
75 copy(dAtA[i:], encoded)
76 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded)))
77 }
78 i--
79 dAtA[i] = 0xa
80 }
81 return len(dAtA) - i, nil
82 }
83
84 func (m *LuaConfig) SizeVT() (n int) {
85 if m == nil {
86 return 0
87 }
88 var l int
89 _ = l
90 if m.SourceCode != nil {
91 if size, ok := interface{}(m.SourceCode).(interface {
92 SizeVT() int
93 }); ok {
94 l = size.SizeVT()
95 } else {
96 l = proto.Size(m.SourceCode)
97 }
98 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
99 }
100 l = len(m.DefaultCluster)
101 if l > 0 {
102 n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
103 }
104 n += len(m.unknownFields)
105 return n
106 }