| 1 |
// Code generated by protoc-gen-go. DO NOT EDIT. |
| 2 |
// versions: |
| 3 |
// protoc-gen-go v1.30.0 |
| 4 |
// protoc v5.29.1 |
| 5 |
// source: envoy/extensions/matching/input_matchers/consistent_hashing/v3/consistent_hashing.proto |
| 6 |
|
| 7 |
package consistent_hashingv3 |
| 8 |
|
| 9 |
import ( |
| 10 |
_ "github.com/cncf/xds/go/udpa/annotations" |
| 11 |
_ "github.com/envoyproxy/protoc-gen-validate/validate" |
| 12 |
protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| 13 |
protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 14 |
reflect "reflect" |
| 15 |
sync "sync" |
| 16 |
) |
| 17 |
|
| 18 |
const ( |
| 19 |
// Verify that this generated code is sufficiently up-to-date. |
| 20 |
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 21 |
// Verify that runtime/protoimpl is sufficiently up-to-date. |
| 22 |
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 23 |
) |
| 24 |
|
| 25 |
// The consistent hashing matchers computes a consistent hash from the input and matches if the resulting hash |
| 26 |
// is within the configured threshold. |
| 27 |
// More specifically, this matcher evaluates to true if hash(input, seed) % modulo >= threshold. |
| 28 |
// Note that the consistency of the match result relies on the internal hash function (xxhash) remaining |
| 29 |
// unchanged. While this is unlikely to happen intentionally, this could cause inconsistent match results |
| 30 |
// between deployments. |
| 31 |
type ConsistentHashing struct { |
| 32 |
state protoimpl.MessageState |
| 33 |
sizeCache protoimpl.SizeCache |
| 34 |
unknownFields protoimpl.UnknownFields |
| 35 |
|
| 36 |
// The threshold the resulting hash must be over in order for this matcher to evaluate to true. |
| 37 |
// This value must be below the configured modulo value. |
| 38 |
// Setting this to 0 is equivalent to this matcher always matching. |
| 39 |
Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` |
| 40 |
// The value to use for the modulus in the calculation. This effectively bounds the hash output, |
| 41 |
// specifying the range of possible values. |
| 42 |
// This value must be above the configured threshold. |
| 43 |
Modulo uint32 `protobuf:"varint,2,opt,name=modulo,proto3" json:"modulo,omitempty"` |
| 44 |
// Optional seed passed through the hash function. This allows using additional information when computing |
| 45 |
// the hash value: by changing the seed value, a different partition of matching and non-matching inputs will |
| 46 |
// be created that remains consistent for that seed value. |
| 47 |
Seed uint64 `protobuf:"varint,3,opt,name=seed,proto3" json:"seed,omitempty"` |
| 48 |
} |
| 49 |
|
| 50 |
func (x *ConsistentHashing) Reset() { |
| 51 |
*x = ConsistentHashing{} |
| 52 |
if protoimpl.UnsafeEnabled { |
| 53 |
mi := &file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes[0] |
| 54 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 55 |
ms.StoreMessageInfo(mi) |
| 56 |
} |
| 57 |
} |
| 58 |
|
| 59 |
func (x *ConsistentHashing) String() string { |
| 60 |
return protoimpl.X.MessageStringOf(x) |
| 61 |
} |
| 62 |
|
| 63 |
func (*ConsistentHashing) ProtoMessage() {} |
| 64 |
|
| 65 |
func (x *ConsistentHashing) ProtoReflect() protoreflect.Message { |
| 66 |
mi := &file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes[0] |
| 67 |
if protoimpl.UnsafeEnabled && x != nil { |
| 68 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 69 |
if ms.LoadMessageInfo() == nil { |
| 70 |
ms.StoreMessageInfo(mi) |
| 71 |
} |
| 72 |
return ms |
| 73 |
} |
| 74 |
return mi.MessageOf(x) |
| 75 |
} |
| 76 |
|
| 77 |
// Deprecated: Use ConsistentHashing.ProtoReflect.Descriptor instead. |
| 78 |
func (*ConsistentHashing) Descriptor() ([]byte, []int) { |
| 79 |
return file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescGZIP(), []int{0} |
| 80 |
} |
| 81 |
|
| 82 |
func (x *ConsistentHashing) GetThreshold() uint32 { |
| 83 |
if x != nil { |
| 84 |
return x.Threshold |
| 85 |
} |
| 86 |
return 0 |
| 87 |
} |
| 88 |
|
| 89 |
func (x *ConsistentHashing) GetModulo() uint32 { |
| 90 |
if x != nil { |
| 91 |
return x.Modulo |
| 92 |
} |
| 93 |
return 0 |
| 94 |
} |
| 95 |
|
| 96 |
func (x *ConsistentHashing) GetSeed() uint64 { |
| 97 |
if x != nil { |
| 98 |
return x.Seed |
| 99 |
} |
| 100 |
return 0 |
| 101 |
} |
| 102 |
|
| 103 |
var File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto protoreflect.FileDescriptor |
| 104 |
|
| 105 |
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc = []byte{ |
| 106 |
0x0a, 0x57, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, |
| 107 |
0x6e, 0x73, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x69, 0x6e, 0x70, 0x75, |
| 108 |
0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, |
| 109 |
0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x33, |
| 110 |
0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, |
| 111 |
0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x3e, 0x65, 0x6e, 0x76, 0x6f, 0x79, |
| 112 |
0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, |
| 113 |
0x68, 0x69, 0x6e, 0x67, 0x2e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, |
| 114 |
0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, |
| 115 |
0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x33, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, |
| 116 |
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, |
| 117 |
0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, |
| 118 |
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, |
| 119 |
0x6f, 0x22, 0x66, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x48, |
| 120 |
0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, |
| 121 |
0x6f, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, |
| 122 |
0x68, 0x6f, 0x6c, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x6f, 0x18, 0x02, |
| 123 |
0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x20, 0x00, 0x52, 0x06, 0x6d, |
| 124 |
0x6f, 0x64, 0x75, 0x6c, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x03, 0x20, |
| 125 |
0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x42, 0xec, 0x01, 0xba, 0x80, 0xc8, 0xd1, |
| 126 |
0x06, 0x02, 0x10, 0x02, 0x0a, 0x4c, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, |
| 127 |
0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, |
| 128 |
0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x69, 0x6e, |
| 129 |
0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x6f, 0x6e, |
| 130 |
0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x2e, |
| 131 |
0x76, 0x33, 0x42, 0x16, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x61, |
| 132 |
0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x7a, 0x67, 0x69, |
| 133 |
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, |
| 134 |
0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, |
| 135 |
0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, |
| 136 |
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x2f, 0x69, |
| 137 |
0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x2f, 0x63, 0x6f, |
| 138 |
0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, |
| 139 |
0x2f, 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x68, |
| 140 |
0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| 141 |
} |
| 142 |
|
| 143 |
var ( |
| 144 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescOnce sync.Once |
| 145 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData = file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc |
| 146 |
) |
| 147 |
|
| 148 |
func file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescGZIP() []byte { |
| 149 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescOnce.Do(func() { |
| 150 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData) |
| 151 |
}) |
| 152 |
return file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData |
| 153 |
} |
| 154 |
|
| 155 |
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes = make([]protoimpl.MessageInfo, 1) |
| 156 |
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes = []interface{}{ |
| 157 |
(*ConsistentHashing)(nil), // 0: envoy.extensions.matching.input_matchers.consistent_hashing.v3.ConsistentHashing |
| 158 |
} |
| 159 |
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs = []int32{ |
| 160 |
0, // [0:0] is the sub-list for method output_type |
| 161 |
0, // [0:0] is the sub-list for method input_type |
| 162 |
0, // [0:0] is the sub-list for extension type_name |
| 163 |
0, // [0:0] is the sub-list for extension extendee |
| 164 |
0, // [0:0] is the sub-list for field type_name |
| 165 |
} |
| 166 |
|
| 167 |
func init() { |
| 168 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_init() |
| 169 |
} |
| 170 |
func file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_init() { |
| 171 |
if File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto != nil { |
| 172 |
return |
| 173 |
} |
| 174 |
if !protoimpl.UnsafeEnabled { |
| 175 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| 176 |
switch v := v.(*ConsistentHashing); i { |
| 177 |
case 0: |
| 178 |
return &v.state |
| 179 |
case 1: |
| 180 |
return &v.sizeCache |
| 181 |
case 2: |
| 182 |
return &v.unknownFields |
| 183 |
default: |
| 184 |
return nil |
| 185 |
} |
| 186 |
} |
| 187 |
} |
| 188 |
type x struct{} |
| 189 |
out := protoimpl.TypeBuilder{ |
| 190 |
File: protoimpl.DescBuilder{ |
| 191 |
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| 192 |
RawDescriptor: file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc, |
| 193 |
NumEnums: 0, |
| 194 |
NumMessages: 1, |
| 195 |
NumExtensions: 0, |
| 196 |
NumServices: 0, |
| 197 |
}, |
| 198 |
GoTypes: file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes, |
| 199 |
DependencyIndexes: file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs, |
| 200 |
MessageInfos: file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes, |
| 201 |
}.Build() |
| 202 |
File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto = out.File |
| 203 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc = nil |
| 204 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes = nil |
| 205 |
file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs = nil |
| 206 |
} |