summaryrefslogtreecommitdiff
path: root/src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs')
-rw-r--r--src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs b/src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs
new file mode 100644
index 00000000..b00ba2c5
--- /dev/null
+++ b/src/rpc/envoy.extensions.matching.input_matchers.consistent_hashing.v3.rs
@@ -0,0 +1,31 @@
+// @generated
+// This file is @generated by prost-build.
+// \[#protodoc-title: Consistent hashing matcher\]
+// \[#extension: envoy.matching.matchers.consistent_hashing\]
+
+/// The consistent hashing matchers computes a consistent hash from the input and matches if the resulting hash
+/// is within the configured threshold.
+/// More specifically, this matcher evaluates to true if hash(input, seed) % modulo >= threshold.
+/// Note that the consistency of the match result relies on the internal hash function (xxhash) remaining
+/// unchanged. While this is unlikely to happen intentionally, this could cause inconsistent match results
+/// between deployments.
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, Copy, PartialEq, ::prost::Message)]
+pub struct ConsistentHashing {
+ /// The threshold the resulting hash must be over in order for this matcher to evaluate to true.
+ /// This value must be below the configured modulo value.
+ /// Setting this to 0 is equivalent to this matcher always matching.
+ #[prost(uint32, tag="1")]
+ pub threshold: u32,
+ /// The value to use for the modulus in the calculation. This effectively bounds the hash output,
+ /// specifying the range of possible values.
+ /// This value must be above the configured threshold.
+ #[prost(uint32, tag="2")]
+ pub modulo: u32,
+ /// Optional seed passed through the hash function. This allows using additional information when computing
+ /// the hash value: by changing the seed value, a different partition of matching and non-matching inputs will
+ /// be created that remains consistent for that seed value.
+ #[prost(uint64, tag="3")]
+ pub seed: u64,
+}
+// @@protoc_insertion_point(module)