// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/extensions/matching/input_matchers/consistent_hashing/v3/consistent_hashing.proto

package consistent_hashingv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// 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.
type ConsistentHashing struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// 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"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ConsistentHashing) Reset() {
	*x = ConsistentHashing{}
	mi := &file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ConsistentHashing) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ConsistentHashing) ProtoMessage() {}

func (x *ConsistentHashing) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ConsistentHashing.ProtoReflect.Descriptor instead.
func (*ConsistentHashing) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescGZIP(), []int{0}
}

func (x *ConsistentHashing) GetThreshold() uint32 {
	if x != nil {
		return x.Threshold
	}
	return 0
}

func (x *ConsistentHashing) GetModulo() uint32 {
	if x != nil {
		return x.Modulo
	}
	return 0
}

func (x *ConsistentHashing) GetSeed() uint64 {
	if x != nil {
		return x.Seed
	}
	return 0
}

var File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto protoreflect.FileDescriptor

const file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc = "" +
	"\n" +
	"Wenvoy/extensions/matching/input_matchers/consistent_hashing/v3/consistent_hashing.proto\x12>envoy.extensions.matching.input_matchers.consistent_hashing.v3\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"f\n" +
	"\x11ConsistentHashing\x12\x1c\n" +
	"\tthreshold\x18\x01 \x01(\rR\tthreshold\x12\x1f\n" +
	"\x06modulo\x18\x02 \x01(\rB\a\xfaB\x04*\x02 \x00R\x06modulo\x12\x12\n" +
	"\x04seed\x18\x03 \x01(\x04R\x04seedB\xec\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"Lio.envoyproxy.envoy.extensions.matching.input_matchers.consistent_hashing.v3B\x16ConsistentHashingProtoP\x01Zzgithub.com/envoyproxy/go-control-plane/envoy/extensions/matching/input_matchers/consistent_hashing/v3;consistent_hashingv3b\x06proto3"

var (
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescOnce sync.Once
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData []byte
)

func file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescGZIP() []byte {
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc), len(file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc)))
	})
	return file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDescData
}

var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes = []any{
	(*ConsistentHashing)(nil), // 0: envoy.extensions.matching.input_matchers.consistent_hashing.v3.ConsistentHashing
}
var file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs = []int32{
	0, // [0:0] is the sub-list for method output_type
	0, // [0:0] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() {
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_init()
}
func file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_init() {
	if File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc), len(file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_msgTypes,
	}.Build()
	File_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto = out.File
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_goTypes = nil
	file_envoy_extensions_matching_input_matchers_consistent_hashing_v3_consistent_hashing_proto_depIdxs = nil
}
