Documentation ¶
Index ¶
- Variables
- type ConsistentHashing
- func (*ConsistentHashing) Descriptor() ([]byte, []int)deprecated
- func (x *ConsistentHashing) GetModulo() uint32
- func (x *ConsistentHashing) GetSeed() uint64
- func (x *ConsistentHashing) GetThreshold() uint32
- func (*ConsistentHashing) ProtoMessage()
- func (x *ConsistentHashing) ProtoReflect() protoreflect.Message
- func (x *ConsistentHashing) Reset()
- func (x *ConsistentHashing) String() string
- func (m *ConsistentHashing) Validate() error
- func (m *ConsistentHashing) ValidateAll() error
- type ConsistentHashingMultiError
- type ConsistentHashingValidationError
- func (e ConsistentHashingValidationError) Cause() error
- func (e ConsistentHashingValidationError) Error() string
- func (e ConsistentHashingValidationError) ErrorName() string
- func (e ConsistentHashingValidationError) Field() string
- func (e ConsistentHashingValidationError) Key() bool
- func (e ConsistentHashingValidationError) Reason() string
Constants ¶
This section is empty.
Variables ¶
var File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ConsistentHashing ¶
type ConsistentHashing struct { // 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. Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` // 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. Modulo uint32 `protobuf:"varint,2,opt,name=modulo,proto3" json:"modulo,omitempty"` // 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. Seed uint64 `protobuf:"varint,3,opt,name=seed,proto3" json:"seed,omitempty"` // contains filtered or unexported fields }
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.
func (*ConsistentHashing) Descriptor
deprecated
func (*ConsistentHashing) Descriptor() ([]byte, []int)
Deprecated: Use ConsistentHashing.ProtoReflect.Descriptor instead.
func (*ConsistentHashing) GetModulo ¶
func (x *ConsistentHashing) GetModulo() uint32
func (*ConsistentHashing) GetSeed ¶
func (x *ConsistentHashing) GetSeed() uint64
func (*ConsistentHashing) GetThreshold ¶
func (x *ConsistentHashing) GetThreshold() uint32
func (*ConsistentHashing) ProtoMessage ¶
func (*ConsistentHashing) ProtoMessage()
func (*ConsistentHashing) ProtoReflect ¶
func (x *ConsistentHashing) ProtoReflect() protoreflect.Message
func (*ConsistentHashing) Reset ¶
func (x *ConsistentHashing) Reset()
func (*ConsistentHashing) String ¶
func (x *ConsistentHashing) String() string
func (*ConsistentHashing) Validate ¶
func (m *ConsistentHashing) Validate() error
Validate checks the field values on ConsistentHashing with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*ConsistentHashing) ValidateAll ¶
func (m *ConsistentHashing) ValidateAll() error
ValidateAll checks the field values on ConsistentHashing with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConsistentHashingMultiError, or nil if none found.
type ConsistentHashingMultiError ¶
type ConsistentHashingMultiError []error
ConsistentHashingMultiError is an error wrapping multiple validation errors returned by ConsistentHashing.ValidateAll() if the designated constraints aren't met.
func (ConsistentHashingMultiError) AllErrors ¶
func (m ConsistentHashingMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConsistentHashingMultiError) Error ¶
func (m ConsistentHashingMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConsistentHashingValidationError ¶
type ConsistentHashingValidationError struct {
// contains filtered or unexported fields
}
ConsistentHashingValidationError is the validation error returned by ConsistentHashing.Validate if the designated constraints aren't met.
func (ConsistentHashingValidationError) Cause ¶
func (e ConsistentHashingValidationError) Cause() error
Cause function returns cause value.
func (ConsistentHashingValidationError) Error ¶
func (e ConsistentHashingValidationError) Error() string
Error satisfies the builtin error interface
func (ConsistentHashingValidationError) ErrorName ¶
func (e ConsistentHashingValidationError) ErrorName() string
ErrorName returns error name.
func (ConsistentHashingValidationError) Field ¶
func (e ConsistentHashingValidationError) Field() string
Field function returns field value.
func (ConsistentHashingValidationError) Key ¶
func (e ConsistentHashingValidationError) Key() bool
Key function returns key value.
func (ConsistentHashingValidationError) Reason ¶
func (e ConsistentHashingValidationError) Reason() string
Reason function returns reason value.