Debian Codegraph @

envoy/extensions/matching/input_matchers/consistent_hashing/v3/consistent_hashing_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/matching/input_matchers/consistent_hashing/v3/consistent_hashing.proto
6
7 package consistent_hashingv3
8
9 import (
10 protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
11 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12 )
13
14 const (
15 // Verify that this generated code is sufficiently up-to-date.
16 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17 // Verify that runtime/protoimpl is sufficiently up-to-date.
18 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19 )
20
21 func (m *ConsistentHashing) MarshalVTStrict() (dAtA []byte, err error) {
22 if m == nil {
23 return nil, nil
24 }
25 size := m.SizeVT()
26 dAtA = make([]byte, size)
27 n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
28 if err != nil {
29 return nil, err
30 }
31 return dAtA[:n], nil
32 }
33
34 func (m *ConsistentHashing) MarshalToVTStrict(dAtA []byte) (int, error) {
35 size := m.SizeVT()
36 return m.MarshalToSizedBufferVTStrict(dAtA[:size])
37 }
38
39 func (m *ConsistentHashing) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
40 if m == nil {
41 return 0, nil
42 }
43 i := len(dAtA)
44 _ = i
45 var l int
46 _ = l
47 if m.unknownFields != nil {
48 i -= len(m.unknownFields)
49 copy(dAtA[i:], m.unknownFields)
50 }
51 if m.Seed != 0 {
52 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Seed))
53 i--
54 dAtA[i] = 0x18
55 }
56 if m.Modulo != 0 {
57 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Modulo))
58 i--
59 dAtA[i] = 0x10
60 }
61 if m.Threshold != 0 {
62 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Threshold))
63 i--
64 dAtA[i] = 0x8
65 }
66 return len(dAtA) - i, nil
67 }
68
69 func (m *ConsistentHashing) SizeVT() (n int) {
70 if m == nil {
71 return 0
72 }
73 var l int
74 _ = l
75 if m.Threshold != 0 {
76 n += 1 + protohelpers.SizeOfVarint(uint64(m.Threshold))
77 }
78 if m.Modulo != 0 {
79 n += 1 + protohelpers.SizeOfVarint(uint64(m.Modulo))
80 }
81 if m.Seed != 0 {
82 n += 1 + protohelpers.SizeOfVarint(uint64(m.Seed))
83 }
84 n += len(m.unknownFields)
85 return n
86 }