diff --git a/go/xds/type/matcher/v3/range.pb.go b/go/xds/type/matcher/v3/range.pb.go new file mode 100644 index 0000000..f7e0533 --- /dev/null +++ b/go/xds/type/matcher/v3/range.pb.go @@ -0,0 +1,544 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.18.0 +// source: xds/type/matcher/v3/range.proto + +package v3 + +import ( + v3 "github.com/cncf/xds/go/xds/type/v3" + _ "github.com/envoyproxy/protoc-gen-validate/validate" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Int64RangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RangeMatchers []*Int64RangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"` +} + +func (x *Int64RangeMatcher) Reset() { + *x = Int64RangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int64RangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64RangeMatcher) ProtoMessage() {} + +func (x *Int64RangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int64RangeMatcher.ProtoReflect.Descriptor instead. +func (*Int64RangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{0} +} + +func (x *Int64RangeMatcher) GetRangeMatchers() []*Int64RangeMatcher_RangeMatcher { + if x != nil { + return x.RangeMatchers + } + return nil +} + +type Int32RangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RangeMatchers []*Int32RangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"` +} + +func (x *Int32RangeMatcher) Reset() { + *x = Int32RangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int32RangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32RangeMatcher) ProtoMessage() {} + +func (x *Int32RangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int32RangeMatcher.ProtoReflect.Descriptor instead. +func (*Int32RangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{1} +} + +func (x *Int32RangeMatcher) GetRangeMatchers() []*Int32RangeMatcher_RangeMatcher { + if x != nil { + return x.RangeMatchers + } + return nil +} + +type DoubleRangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RangeMatchers []*DoubleRangeMatcher_RangeMatcher `protobuf:"bytes,1,rep,name=range_matchers,json=rangeMatchers,proto3" json:"range_matchers,omitempty"` +} + +func (x *DoubleRangeMatcher) Reset() { + *x = DoubleRangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleRangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleRangeMatcher) ProtoMessage() {} + +func (x *DoubleRangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoubleRangeMatcher.ProtoReflect.Descriptor instead. +func (*DoubleRangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{2} +} + +func (x *DoubleRangeMatcher) GetRangeMatchers() []*DoubleRangeMatcher_RangeMatcher { + if x != nil { + return x.RangeMatchers + } + return nil +} + +type Int64RangeMatcher_RangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ranges []*v3.Int64Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"` + OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"` +} + +func (x *Int64RangeMatcher_RangeMatcher) Reset() { + *x = Int64RangeMatcher_RangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int64RangeMatcher_RangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64RangeMatcher_RangeMatcher) ProtoMessage() {} + +func (x *Int64RangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int64RangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead. +func (*Int64RangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Int64RangeMatcher_RangeMatcher) GetRanges() []*v3.Int64Range { + if x != nil { + return x.Ranges + } + return nil +} + +func (x *Int64RangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch { + if x != nil { + return x.OnMatch + } + return nil +} + +type Int32RangeMatcher_RangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ranges []*v3.Int32Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"` + OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"` +} + +func (x *Int32RangeMatcher_RangeMatcher) Reset() { + *x = Int32RangeMatcher_RangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int32RangeMatcher_RangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32RangeMatcher_RangeMatcher) ProtoMessage() {} + +func (x *Int32RangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int32RangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead. +func (*Int32RangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Int32RangeMatcher_RangeMatcher) GetRanges() []*v3.Int32Range { + if x != nil { + return x.Ranges + } + return nil +} + +func (x *Int32RangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch { + if x != nil { + return x.OnMatch + } + return nil +} + +type DoubleRangeMatcher_RangeMatcher struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ranges []*v3.DoubleRange `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"` + OnMatch *Matcher_OnMatch `protobuf:"bytes,2,opt,name=on_match,json=onMatch,proto3" json:"on_match,omitempty"` +} + +func (x *DoubleRangeMatcher_RangeMatcher) Reset() { + *x = DoubleRangeMatcher_RangeMatcher{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleRangeMatcher_RangeMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleRangeMatcher_RangeMatcher) ProtoMessage() {} + +func (x *DoubleRangeMatcher_RangeMatcher) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_matcher_v3_range_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoubleRangeMatcher_RangeMatcher.ProtoReflect.Descriptor instead. +func (*DoubleRangeMatcher_RangeMatcher) Descriptor() ([]byte, []int) { + return file_xds_type_matcher_v3_range_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *DoubleRangeMatcher_RangeMatcher) GetRanges() []*v3.DoubleRange { + if x != nil { + return x.Ranges + } + return nil +} + +func (x *DoubleRangeMatcher_RangeMatcher) GetOnMatch() *Matcher_OnMatch { + if x != nil { + return x.OnMatch + } + return nil +} + +var File_xds_type_matcher_v3_range_proto protoreflect.FileDescriptor + +var file_xds_type_matcher_v3_range_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x17, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x21, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x11, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x12, 0x5a, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x64, 0x73, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8a, 0x01, + 0x0a, 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x39, + 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74, + 0x36, 0x34, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, + 0x01, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, + 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, + 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xfc, 0x01, 0x0a, 0x11, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x12, 0x5a, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8a, 0x01, 0x0a, + 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, + 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, + 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xff, 0x01, 0x0a, 0x12, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x12, 0x5b, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x44, + 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x52, 0x0d, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73, 0x1a, 0x8b, 0x01, + 0x0a, 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3a, + 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x6f, 0x75, + 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, + 0x08, 0x01, 0x52, 0x06, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, + 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, + 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x5a, 0x0a, 0x1e, 0x63, + 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, + 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_xds_type_matcher_v3_range_proto_rawDescOnce sync.Once + file_xds_type_matcher_v3_range_proto_rawDescData = file_xds_type_matcher_v3_range_proto_rawDesc +) + +func file_xds_type_matcher_v3_range_proto_rawDescGZIP() []byte { + file_xds_type_matcher_v3_range_proto_rawDescOnce.Do(func() { + file_xds_type_matcher_v3_range_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_matcher_v3_range_proto_rawDescData) + }) + return file_xds_type_matcher_v3_range_proto_rawDescData +} + +var file_xds_type_matcher_v3_range_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_xds_type_matcher_v3_range_proto_goTypes = []interface{}{ + (*Int64RangeMatcher)(nil), // 0: xds.type.matcher.v3.Int64RangeMatcher + (*Int32RangeMatcher)(nil), // 1: xds.type.matcher.v3.Int32RangeMatcher + (*DoubleRangeMatcher)(nil), // 2: xds.type.matcher.v3.DoubleRangeMatcher + (*Int64RangeMatcher_RangeMatcher)(nil), // 3: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher + (*Int32RangeMatcher_RangeMatcher)(nil), // 4: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher + (*DoubleRangeMatcher_RangeMatcher)(nil), // 5: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher + (*v3.Int64Range)(nil), // 6: xds.type.v3.Int64Range + (*Matcher_OnMatch)(nil), // 7: xds.type.matcher.v3.Matcher.OnMatch + (*v3.Int32Range)(nil), // 8: xds.type.v3.Int32Range + (*v3.DoubleRange)(nil), // 9: xds.type.v3.DoubleRange +} +var file_xds_type_matcher_v3_range_proto_depIdxs = []int32{ + 3, // 0: xds.type.matcher.v3.Int64RangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher + 4, // 1: xds.type.matcher.v3.Int32RangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher + 5, // 2: xds.type.matcher.v3.DoubleRangeMatcher.range_matchers:type_name -> xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher + 6, // 3: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.Int64Range + 7, // 4: xds.type.matcher.v3.Int64RangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch + 8, // 5: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.Int32Range + 7, // 6: xds.type.matcher.v3.Int32RangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch + 9, // 7: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher.ranges:type_name -> xds.type.v3.DoubleRange + 7, // 8: xds.type.matcher.v3.DoubleRangeMatcher.RangeMatcher.on_match:type_name -> xds.type.matcher.v3.Matcher.OnMatch + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_xds_type_matcher_v3_range_proto_init() } +func file_xds_type_matcher_v3_range_proto_init() { + if File_xds_type_matcher_v3_range_proto != nil { + return + } + file_xds_type_matcher_v3_matcher_proto_init() + if !protoimpl.UnsafeEnabled { + file_xds_type_matcher_v3_range_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int64RangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_matcher_v3_range_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int32RangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_matcher_v3_range_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleRangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_matcher_v3_range_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int64RangeMatcher_RangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_matcher_v3_range_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int32RangeMatcher_RangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_matcher_v3_range_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleRangeMatcher_RangeMatcher); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_xds_type_matcher_v3_range_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_xds_type_matcher_v3_range_proto_goTypes, + DependencyIndexes: file_xds_type_matcher_v3_range_proto_depIdxs, + MessageInfos: file_xds_type_matcher_v3_range_proto_msgTypes, + }.Build() + File_xds_type_matcher_v3_range_proto = out.File + file_xds_type_matcher_v3_range_proto_rawDesc = nil + file_xds_type_matcher_v3_range_proto_goTypes = nil + file_xds_type_matcher_v3_range_proto_depIdxs = nil +} diff --git a/go/xds/type/matcher/v3/range.pb.validate.go b/go/xds/type/matcher/v3/range.pb.validate.go new file mode 100644 index 0000000..00b7a03 --- /dev/null +++ b/go/xds/type/matcher/v3/range.pb.validate.go @@ -0,0 +1,580 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: xds/type/matcher/v3/range.proto + +package v3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} +) + +// Validate checks the field values on Int64RangeMatcher with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *Int64RangeMatcher) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRangeMatchers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int64RangeMatcherValidationError{ + field: fmt.Sprintf("RangeMatchers[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// Int64RangeMatcherValidationError is the validation error returned by +// Int64RangeMatcher.Validate if the designated constraints aren't met. +type Int64RangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int64RangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int64RangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int64RangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int64RangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int64RangeMatcherValidationError) ErrorName() string { + return "Int64RangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e Int64RangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt64RangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int64RangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int64RangeMatcherValidationError{} + +// Validate checks the field values on Int32RangeMatcher with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *Int32RangeMatcher) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRangeMatchers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int32RangeMatcherValidationError{ + field: fmt.Sprintf("RangeMatchers[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// Int32RangeMatcherValidationError is the validation error returned by +// Int32RangeMatcher.Validate if the designated constraints aren't met. +type Int32RangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int32RangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int32RangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int32RangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int32RangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int32RangeMatcherValidationError) ErrorName() string { + return "Int32RangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e Int32RangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt32RangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int32RangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int32RangeMatcherValidationError{} + +// Validate checks the field values on DoubleRangeMatcher with the rules +// defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DoubleRangeMatcher) Validate() error { + if m == nil { + return nil + } + + for idx, item := range m.GetRangeMatchers() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DoubleRangeMatcherValidationError{ + field: fmt.Sprintf("RangeMatchers[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + return nil +} + +// DoubleRangeMatcherValidationError is the validation error returned by +// DoubleRangeMatcher.Validate if the designated constraints aren't met. +type DoubleRangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DoubleRangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DoubleRangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DoubleRangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DoubleRangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DoubleRangeMatcherValidationError) ErrorName() string { + return "DoubleRangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e DoubleRangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDoubleRangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DoubleRangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DoubleRangeMatcherValidationError{} + +// Validate checks the field values on Int64RangeMatcher_RangeMatcher with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Int64RangeMatcher_RangeMatcher) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRanges()) < 1 { + return Int64RangeMatcher_RangeMatcherValidationError{ + field: "Ranges", + reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetRanges() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int64RangeMatcher_RangeMatcherValidationError{ + field: fmt.Sprintf("Ranges[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int64RangeMatcher_RangeMatcherValidationError{ + field: "OnMatch", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// Int64RangeMatcher_RangeMatcherValidationError is the validation error +// returned by Int64RangeMatcher_RangeMatcher.Validate if the designated +// constraints aren't met. +type Int64RangeMatcher_RangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int64RangeMatcher_RangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int64RangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int64RangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int64RangeMatcher_RangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int64RangeMatcher_RangeMatcherValidationError) ErrorName() string { + return "Int64RangeMatcher_RangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e Int64RangeMatcher_RangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt64RangeMatcher_RangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int64RangeMatcher_RangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int64RangeMatcher_RangeMatcherValidationError{} + +// Validate checks the field values on Int32RangeMatcher_RangeMatcher with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *Int32RangeMatcher_RangeMatcher) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRanges()) < 1 { + return Int32RangeMatcher_RangeMatcherValidationError{ + field: "Ranges", + reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetRanges() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int32RangeMatcher_RangeMatcherValidationError{ + field: fmt.Sprintf("Ranges[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Int32RangeMatcher_RangeMatcherValidationError{ + field: "OnMatch", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// Int32RangeMatcher_RangeMatcherValidationError is the validation error +// returned by Int32RangeMatcher_RangeMatcher.Validate if the designated +// constraints aren't met. +type Int32RangeMatcher_RangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int32RangeMatcher_RangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int32RangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int32RangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int32RangeMatcher_RangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int32RangeMatcher_RangeMatcherValidationError) ErrorName() string { + return "Int32RangeMatcher_RangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e Int32RangeMatcher_RangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt32RangeMatcher_RangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int32RangeMatcher_RangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int32RangeMatcher_RangeMatcherValidationError{} + +// Validate checks the field values on DoubleRangeMatcher_RangeMatcher with the +// rules defined in the proto definition for this message. If any rules are +// violated, an error is returned. +func (m *DoubleRangeMatcher_RangeMatcher) Validate() error { + if m == nil { + return nil + } + + if len(m.GetRanges()) < 1 { + return DoubleRangeMatcher_RangeMatcherValidationError{ + field: "Ranges", + reason: "value must contain at least 1 item(s)", + } + } + + for idx, item := range m.GetRanges() { + _, _ = idx, item + + if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DoubleRangeMatcher_RangeMatcherValidationError{ + field: fmt.Sprintf("Ranges[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if v, ok := interface{}(m.GetOnMatch()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return DoubleRangeMatcher_RangeMatcherValidationError{ + field: "OnMatch", + reason: "embedded message failed validation", + cause: err, + } + } + } + + return nil +} + +// DoubleRangeMatcher_RangeMatcherValidationError is the validation error +// returned by DoubleRangeMatcher_RangeMatcher.Validate if the designated +// constraints aren't met. +type DoubleRangeMatcher_RangeMatcherValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DoubleRangeMatcher_RangeMatcherValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DoubleRangeMatcher_RangeMatcherValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DoubleRangeMatcher_RangeMatcherValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DoubleRangeMatcher_RangeMatcherValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DoubleRangeMatcher_RangeMatcherValidationError) ErrorName() string { + return "DoubleRangeMatcher_RangeMatcherValidationError" +} + +// Error satisfies the builtin error interface +func (e DoubleRangeMatcher_RangeMatcherValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDoubleRangeMatcher_RangeMatcher.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DoubleRangeMatcher_RangeMatcherValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DoubleRangeMatcher_RangeMatcherValidationError{} diff --git a/go/xds/type/v3/range.pb.go b/go/xds/type/v3/range.pb.go new file mode 100644 index 0000000..883cd43 --- /dev/null +++ b/go/xds/type/v3/range.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.18.0 +// source: xds/type/v3/range.proto + +package v3 + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Int64Range struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (x *Int64Range) Reset() { + *x = Int64Range{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_v3_range_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int64Range) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int64Range) ProtoMessage() {} + +func (x *Int64Range) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_v3_range_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int64Range.ProtoReflect.Descriptor instead. +func (*Int64Range) Descriptor() ([]byte, []int) { + return file_xds_type_v3_range_proto_rawDescGZIP(), []int{0} +} + +func (x *Int64Range) GetStart() int64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *Int64Range) GetEnd() int64 { + if x != nil { + return x.End + } + return 0 +} + +type Int32Range struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start int32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` + End int32 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (x *Int32Range) Reset() { + *x = Int32Range{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_v3_range_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Int32Range) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Int32Range) ProtoMessage() {} + +func (x *Int32Range) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_v3_range_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Int32Range.ProtoReflect.Descriptor instead. +func (*Int32Range) Descriptor() ([]byte, []int) { + return file_xds_type_v3_range_proto_rawDescGZIP(), []int{1} +} + +func (x *Int32Range) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *Int32Range) GetEnd() int32 { + if x != nil { + return x.End + } + return 0 +} + +type DoubleRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start float64 `protobuf:"fixed64,1,opt,name=start,proto3" json:"start,omitempty"` + End float64 `protobuf:"fixed64,2,opt,name=end,proto3" json:"end,omitempty"` +} + +func (x *DoubleRange) Reset() { + *x = DoubleRange{} + if protoimpl.UnsafeEnabled { + mi := &file_xds_type_v3_range_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DoubleRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DoubleRange) ProtoMessage() {} + +func (x *DoubleRange) ProtoReflect() protoreflect.Message { + mi := &file_xds_type_v3_range_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DoubleRange.ProtoReflect.Descriptor instead. +func (*DoubleRange) Descriptor() ([]byte, []int) { + return file_xds_type_v3_range_proto_rawDescGZIP(), []int{2} +} + +func (x *DoubleRange) GetStart() float64 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *DoubleRange) GetEnd() float64 { + if x != nil { + return x.End + } + return 0 +} + +var File_xds_type_v3_range_proto protoreflect.FileDescriptor + +var file_xds_type_v3_range_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x64, 0x73, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x2e, 0x76, 0x33, 0x22, 0x34, 0x0a, 0x0a, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x34, 0x0a, 0x0a, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, + 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x0b, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x42, 0x4a, 0x0a, 0x16, 0x63, 0x6f, 0x6d, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x2e, 0x76, 0x33, 0x42, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, + 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_xds_type_v3_range_proto_rawDescOnce sync.Once + file_xds_type_v3_range_proto_rawDescData = file_xds_type_v3_range_proto_rawDesc +) + +func file_xds_type_v3_range_proto_rawDescGZIP() []byte { + file_xds_type_v3_range_proto_rawDescOnce.Do(func() { + file_xds_type_v3_range_proto_rawDescData = protoimpl.X.CompressGZIP(file_xds_type_v3_range_proto_rawDescData) + }) + return file_xds_type_v3_range_proto_rawDescData +} + +var file_xds_type_v3_range_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_xds_type_v3_range_proto_goTypes = []interface{}{ + (*Int64Range)(nil), // 0: xds.type.v3.Int64Range + (*Int32Range)(nil), // 1: xds.type.v3.Int32Range + (*DoubleRange)(nil), // 2: xds.type.v3.DoubleRange +} +var file_xds_type_v3_range_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_xds_type_v3_range_proto_init() } +func file_xds_type_v3_range_proto_init() { + if File_xds_type_v3_range_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_xds_type_v3_range_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int64Range); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_v3_range_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Int32Range); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_xds_type_v3_range_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DoubleRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_xds_type_v3_range_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_xds_type_v3_range_proto_goTypes, + DependencyIndexes: file_xds_type_v3_range_proto_depIdxs, + MessageInfos: file_xds_type_v3_range_proto_msgTypes, + }.Build() + File_xds_type_v3_range_proto = out.File + file_xds_type_v3_range_proto_rawDesc = nil + file_xds_type_v3_range_proto_goTypes = nil + file_xds_type_v3_range_proto_depIdxs = nil +} diff --git a/go/xds/type/v3/range.pb.validate.go b/go/xds/type/v3/range.pb.validate.go new file mode 100644 index 0000000..7fd141a --- /dev/null +++ b/go/xds/type/v3/range.pb.validate.go @@ -0,0 +1,239 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: xds/type/v3/range.proto + +package v3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} +) + +// Validate checks the field values on Int64Range with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Int64Range) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Start + + // no validation rules for End + + return nil +} + +// Int64RangeValidationError is the validation error returned by +// Int64Range.Validate if the designated constraints aren't met. +type Int64RangeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int64RangeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int64RangeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int64RangeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int64RangeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int64RangeValidationError) ErrorName() string { return "Int64RangeValidationError" } + +// Error satisfies the builtin error interface +func (e Int64RangeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt64Range.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int64RangeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int64RangeValidationError{} + +// Validate checks the field values on Int32Range with the rules defined in the +// proto definition for this message. If any rules are violated, an error is returned. +func (m *Int32Range) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Start + + // no validation rules for End + + return nil +} + +// Int32RangeValidationError is the validation error returned by +// Int32Range.Validate if the designated constraints aren't met. +type Int32RangeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Int32RangeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Int32RangeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Int32RangeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Int32RangeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Int32RangeValidationError) ErrorName() string { return "Int32RangeValidationError" } + +// Error satisfies the builtin error interface +func (e Int32RangeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInt32Range.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Int32RangeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Int32RangeValidationError{} + +// Validate checks the field values on DoubleRange with the rules defined in +// the proto definition for this message. If any rules are violated, an error +// is returned. +func (m *DoubleRange) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Start + + // no validation rules for End + + return nil +} + +// DoubleRangeValidationError is the validation error returned by +// DoubleRange.Validate if the designated constraints aren't met. +type DoubleRangeValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DoubleRangeValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DoubleRangeValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DoubleRangeValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DoubleRangeValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DoubleRangeValidationError) ErrorName() string { return "DoubleRangeValidationError" } + +// Error satisfies the builtin error interface +func (e DoubleRangeValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDoubleRange.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DoubleRangeValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DoubleRangeValidationError{} diff --git a/xds/type/matcher/v3/BUILD b/xds/type/matcher/v3/BUILD index ec0dfe1..a83f44b 100644 --- a/xds/type/matcher/v3/BUILD +++ b/xds/type/matcher/v3/BUILD @@ -6,5 +6,6 @@ xds_proto_package( deps = [ "//xds/annotations/v3:pkg", "//xds/core/v3:pkg", + "//xds/type/v3:pkg", ] ) diff --git a/xds/type/matcher/v3/ip.proto b/xds/type/matcher/v3/ip.proto index eafee5e..ad3ab06 100644 --- a/xds/type/matcher/v3/ip.proto +++ b/xds/type/matcher/v3/ip.proto @@ -19,7 +19,7 @@ option (xds.annotations.v3.file_status).work_in_progress = true; // Matches a specific IP address against a set of possibly overlapping subnets using a trie. message IPMatcher { - // Specifies an optional list of IP address ranges and a match action. + // Specifies a list of IP address ranges and a match action. message IPRangeMatcher { // A non-empty set of CIDR ranges. repeated core.v3.CidrRange ranges = 1 [(validate.rules).repeated = {min_items: 1}]; diff --git a/xds/type/matcher/v3/range.proto b/xds/type/matcher/v3/range.proto new file mode 100644 index 0000000..5834009 --- /dev/null +++ b/xds/type/matcher/v3/range.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package xds.type.matcher.v3; + +import "xds/type/v3/range.proto"; +import "xds/type/matcher/v3/matcher.proto"; + +import "validate/validate.proto"; + +option java_package = "com.github.xds.type.matcher.v3"; +option java_outer_classname = "RangeProto"; +option java_multiple_files = true; +option go_package = "github.com/cncf/xds/go/xds/type/matcher/v3"; + +// [#protodoc-title: Range matcher] + +// Specifies a set of ranges for matching an int64 number and the associated +// match actions. +message Int64RangeMatcher { + // Specifies a list of number ranges and a match action. + message RangeMatcher { + // A non-empty set of int64 ranges. + repeated xds.type.v3.Int64Range ranges = 1 + [(validate.rules).repeated = { min_items: 1 }]; + + // Match action to apply when the input number is within one of the ranges. + Matcher.OnMatch on_match = 2; + } + + // Match a number by a list of number ranges. If multiple ranges contain the + // input number, then the first action in this list is taken. + repeated RangeMatcher range_matchers = 1; +} + +// Specifies a set of ranges for matching an int32 number and the associated +// match actions. +message Int32RangeMatcher { + // Specifies a list of number ranges and a match action. + message RangeMatcher { + // A non-empty set of int32 ranges. + repeated xds.type.v3.Int32Range ranges = 1 + [(validate.rules).repeated = { min_items: 1 }]; + + // Match action to apply when the input number is within one of the ranges. + Matcher.OnMatch on_match = 2; + } + + // Match a number by a list of number ranges. If multiple ranges contain the + // input number, then the first action in this list is taken. + repeated RangeMatcher range_matchers = 1; +} + +// Specifies a set of ranges for matching a double number and the associated +// match actions. +message DoubleRangeMatcher { + // Specifies a list of number ranges and a match action. + message RangeMatcher { + // A non-empty set of double ranges. + repeated xds.type.v3.DoubleRange ranges = 1 + [(validate.rules).repeated = { min_items: 1 }]; + + // Match action to apply when the input number is within one of the ranges. + Matcher.OnMatch on_match = 2; + } + + // Match a number by a list of number ranges. If multiple ranges contain the + // input number, then the first action in this list is taken. + repeated RangeMatcher range_matchers = 1; +} diff --git a/xds/type/v3/range.proto b/xds/type/v3/range.proto new file mode 100644 index 0000000..8fc97ab --- /dev/null +++ b/xds/type/v3/range.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package xds.type.v3; + +option java_package = "com.github.xds.type.v3"; +option java_outer_classname = "RangeProto"; +option java_multiple_files = true; +option go_package = "github.com/cncf/xds/go/xds/type/v3"; + +// [#protodoc-title: Number range] + +// Specifies the int64 start and end of the range using half-open interval +// semantics [start, end). +message Int64Range { + // start of the range (inclusive) + int64 start = 1; + + // end of the range (exclusive) + int64 end = 2; +} + +// Specifies the int32 start and end of the range using half-open interval +// semantics [start, end). +message Int32Range { + // start of the range (inclusive) + int32 start = 1; + + // end of the range (exclusive) + int32 end = 2; +} + +// Specifies the double start and end of the range using half-open interval +// semantics [start, end). +message DoubleRange { + // start of the range (inclusive) + double start = 1; + + // end of the range (exclusive) + double end = 2; +}