diff --git a/pkg/rpc/pb/service_ip_list.pb.go b/pkg/rpc/pb/service_ip_list.pb.go index 12bc7b1..2cf304d 100644 --- a/pkg/rpc/pb/service_ip_list.pb.go +++ b/pkg/rpc/pb/service_ip_list.pb.go @@ -673,6 +673,101 @@ func (x *ExistsEnabledIPListResponse) GetExists() bool { return false } +// 根据IP来搜索IP名单 +type FindEnabledIPListContainsIPRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` +} + +func (x *FindEnabledIPListContainsIPRequest) Reset() { + *x = FindEnabledIPListContainsIPRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPListContainsIPRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPListContainsIPRequest) ProtoMessage() {} + +func (x *FindEnabledIPListContainsIPRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[11] + 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 FindEnabledIPListContainsIPRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledIPListContainsIPRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{11} +} + +func (x *FindEnabledIPListContainsIPRequest) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +type FindEnabledIPListContainsIPResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpLists []*IPList `protobuf:"bytes,1,rep,name=ipLists,proto3" json:"ipLists,omitempty"` +} + +func (x *FindEnabledIPListContainsIPResponse) Reset() { + *x = FindEnabledIPListContainsIPResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPListContainsIPResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPListContainsIPResponse) ProtoMessage() {} + +func (x *FindEnabledIPListContainsIPResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[12] + 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 FindEnabledIPListContainsIPResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledIPListContainsIPResponse) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{12} +} + +func (x *FindEnabledIPListContainsIPResponse) GetIpLists() []*IPList { + if x != nil { + return x.IpLists + } + return nil +} + var File_service_ip_list_proto protoreflect.FileDescriptor var file_service_ip_list_proto_rawDesc = []byte{ @@ -743,42 +838,57 @@ var file_service_ip_list_proto_rawDesc = []byte{ 0x74, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x1b, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x32, 0x96, 0x04, 0x0a, 0x0d, 0x49, - 0x50, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, - 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, - 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, - 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, - 0x69, 0x73, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, - 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, - 0x12, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, - 0x73, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, + 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x34, 0x0a, 0x22, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x49, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, + 0x22, 0x4b, 0x0a, 0x23, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x49, 0x50, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x69, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x07, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x32, 0x86, 0x05, + 0x0a, 0x0d, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x41, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, - 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, 0x13, 0x65, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x11, 0x66, + 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, + 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, + 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x53, 0x0a, 0x12, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x56, + 0x0a, 0x13, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, + 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x73, 0x49, 0x50, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x73, 0x49, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x49, 0x50, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -793,45 +903,50 @@ func file_service_ip_list_proto_rawDescGZIP() []byte { return file_service_ip_list_proto_rawDescData } -var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_service_ip_list_proto_goTypes = []interface{}{ - (*CreateIPListRequest)(nil), // 0: pb.CreateIPListRequest - (*CreateIPListResponse)(nil), // 1: pb.CreateIPListResponse - (*UpdateIPListRequest)(nil), // 2: pb.UpdateIPListRequest - (*FindEnabledIPListRequest)(nil), // 3: pb.FindEnabledIPListRequest - (*FindEnabledIPListResponse)(nil), // 4: pb.FindEnabledIPListResponse - (*CountAllEnabledIPListsRequest)(nil), // 5: pb.CountAllEnabledIPListsRequest - (*ListEnabledIPListsRequest)(nil), // 6: pb.ListEnabledIPListsRequest - (*ListEnabledIPListsResponse)(nil), // 7: pb.ListEnabledIPListsResponse - (*DeleteIPListRequest)(nil), // 8: pb.DeleteIPListRequest - (*ExistsEnabledIPListRequest)(nil), // 9: pb.ExistsEnabledIPListRequest - (*ExistsEnabledIPListResponse)(nil), // 10: pb.ExistsEnabledIPListResponse - (*IPList)(nil), // 11: pb.IPList - (*RPCSuccess)(nil), // 12: pb.RPCSuccess - (*RPCCountResponse)(nil), // 13: pb.RPCCountResponse + (*CreateIPListRequest)(nil), // 0: pb.CreateIPListRequest + (*CreateIPListResponse)(nil), // 1: pb.CreateIPListResponse + (*UpdateIPListRequest)(nil), // 2: pb.UpdateIPListRequest + (*FindEnabledIPListRequest)(nil), // 3: pb.FindEnabledIPListRequest + (*FindEnabledIPListResponse)(nil), // 4: pb.FindEnabledIPListResponse + (*CountAllEnabledIPListsRequest)(nil), // 5: pb.CountAllEnabledIPListsRequest + (*ListEnabledIPListsRequest)(nil), // 6: pb.ListEnabledIPListsRequest + (*ListEnabledIPListsResponse)(nil), // 7: pb.ListEnabledIPListsResponse + (*DeleteIPListRequest)(nil), // 8: pb.DeleteIPListRequest + (*ExistsEnabledIPListRequest)(nil), // 9: pb.ExistsEnabledIPListRequest + (*ExistsEnabledIPListResponse)(nil), // 10: pb.ExistsEnabledIPListResponse + (*FindEnabledIPListContainsIPRequest)(nil), // 11: pb.FindEnabledIPListContainsIPRequest + (*FindEnabledIPListContainsIPResponse)(nil), // 12: pb.FindEnabledIPListContainsIPResponse + (*IPList)(nil), // 13: pb.IPList + (*RPCSuccess)(nil), // 14: pb.RPCSuccess + (*RPCCountResponse)(nil), // 15: pb.RPCCountResponse } var file_service_ip_list_proto_depIdxs = []int32{ - 11, // 0: pb.FindEnabledIPListResponse.ipList:type_name -> pb.IPList - 11, // 1: pb.ListEnabledIPListsResponse.ipLists:type_name -> pb.IPList - 0, // 2: pb.IPListService.createIPList:input_type -> pb.CreateIPListRequest - 2, // 3: pb.IPListService.updateIPList:input_type -> pb.UpdateIPListRequest - 3, // 4: pb.IPListService.findEnabledIPList:input_type -> pb.FindEnabledIPListRequest - 5, // 5: pb.IPListService.countAllEnabledIPLists:input_type -> pb.CountAllEnabledIPListsRequest - 6, // 6: pb.IPListService.listEnabledIPLists:input_type -> pb.ListEnabledIPListsRequest - 8, // 7: pb.IPListService.deleteIPList:input_type -> pb.DeleteIPListRequest - 9, // 8: pb.IPListService.existsEnabledIPList:input_type -> pb.ExistsEnabledIPListRequest - 1, // 9: pb.IPListService.createIPList:output_type -> pb.CreateIPListResponse - 12, // 10: pb.IPListService.updateIPList:output_type -> pb.RPCSuccess - 4, // 11: pb.IPListService.findEnabledIPList:output_type -> pb.FindEnabledIPListResponse - 13, // 12: pb.IPListService.countAllEnabledIPLists:output_type -> pb.RPCCountResponse - 7, // 13: pb.IPListService.listEnabledIPLists:output_type -> pb.ListEnabledIPListsResponse - 12, // 14: pb.IPListService.deleteIPList:output_type -> pb.RPCSuccess - 10, // 15: pb.IPListService.existsEnabledIPList:output_type -> pb.ExistsEnabledIPListResponse - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 13, // 0: pb.FindEnabledIPListResponse.ipList:type_name -> pb.IPList + 13, // 1: pb.ListEnabledIPListsResponse.ipLists:type_name -> pb.IPList + 13, // 2: pb.FindEnabledIPListContainsIPResponse.ipLists:type_name -> pb.IPList + 0, // 3: pb.IPListService.createIPList:input_type -> pb.CreateIPListRequest + 2, // 4: pb.IPListService.updateIPList:input_type -> pb.UpdateIPListRequest + 3, // 5: pb.IPListService.findEnabledIPList:input_type -> pb.FindEnabledIPListRequest + 5, // 6: pb.IPListService.countAllEnabledIPLists:input_type -> pb.CountAllEnabledIPListsRequest + 6, // 7: pb.IPListService.listEnabledIPLists:input_type -> pb.ListEnabledIPListsRequest + 8, // 8: pb.IPListService.deleteIPList:input_type -> pb.DeleteIPListRequest + 9, // 9: pb.IPListService.existsEnabledIPList:input_type -> pb.ExistsEnabledIPListRequest + 11, // 10: pb.IPListService.findEnabledIPListContainsIP:input_type -> pb.FindEnabledIPListContainsIPRequest + 1, // 11: pb.IPListService.createIPList:output_type -> pb.CreateIPListResponse + 14, // 12: pb.IPListService.updateIPList:output_type -> pb.RPCSuccess + 4, // 13: pb.IPListService.findEnabledIPList:output_type -> pb.FindEnabledIPListResponse + 15, // 14: pb.IPListService.countAllEnabledIPLists:output_type -> pb.RPCCountResponse + 7, // 15: pb.IPListService.listEnabledIPLists:output_type -> pb.ListEnabledIPListsResponse + 14, // 16: pb.IPListService.deleteIPList:output_type -> pb.RPCSuccess + 10, // 17: pb.IPListService.existsEnabledIPList:output_type -> pb.ExistsEnabledIPListResponse + 12, // 18: pb.IPListService.findEnabledIPListContainsIP:output_type -> pb.FindEnabledIPListContainsIPResponse + 11, // [11:19] is the sub-list for method output_type + 3, // [3:11] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_ip_list_proto_init() } @@ -974,6 +1089,30 @@ func file_service_ip_list_proto_init() { return nil } } + file_service_ip_list_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPListContainsIPRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_ip_list_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPListContainsIPResponse); 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{ @@ -981,7 +1120,7 @@ func file_service_ip_list_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_ip_list_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, @@ -1021,6 +1160,8 @@ type IPListServiceClient interface { DeleteIPList(ctx context.Context, in *DeleteIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error) // 检查IPList是否存在 ExistsEnabledIPList(ctx context.Context, in *ExistsEnabledIPListRequest, opts ...grpc.CallOption) (*ExistsEnabledIPListResponse, error) + // 根据IP来搜索IP名单 + FindEnabledIPListContainsIP(ctx context.Context, in *FindEnabledIPListContainsIPRequest, opts ...grpc.CallOption) (*FindEnabledIPListContainsIPResponse, error) } type iPListServiceClient struct { @@ -1094,6 +1235,15 @@ func (c *iPListServiceClient) ExistsEnabledIPList(ctx context.Context, in *Exist return out, nil } +func (c *iPListServiceClient) FindEnabledIPListContainsIP(ctx context.Context, in *FindEnabledIPListContainsIPRequest, opts ...grpc.CallOption) (*FindEnabledIPListContainsIPResponse, error) { + out := new(FindEnabledIPListContainsIPResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/findEnabledIPListContainsIP", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // IPListServiceServer is the server API for IPListService service. type IPListServiceServer interface { // 创建IP列表 @@ -1110,6 +1260,8 @@ type IPListServiceServer interface { DeleteIPList(context.Context, *DeleteIPListRequest) (*RPCSuccess, error) // 检查IPList是否存在 ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error) + // 根据IP来搜索IP名单 + FindEnabledIPListContainsIP(context.Context, *FindEnabledIPListContainsIPRequest) (*FindEnabledIPListContainsIPResponse, error) } // UnimplementedIPListServiceServer can be embedded to have forward compatible implementations. @@ -1137,6 +1289,9 @@ func (*UnimplementedIPListServiceServer) DeleteIPList(context.Context, *DeleteIP func (*UnimplementedIPListServiceServer) ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExistsEnabledIPList not implemented") } +func (*UnimplementedIPListServiceServer) FindEnabledIPListContainsIP(context.Context, *FindEnabledIPListContainsIPRequest) (*FindEnabledIPListContainsIPResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPListContainsIP not implemented") +} func RegisterIPListServiceServer(s *grpc.Server, srv IPListServiceServer) { s.RegisterService(&_IPListService_serviceDesc, srv) @@ -1268,6 +1423,24 @@ func _IPListService_ExistsEnabledIPList_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _IPListService_FindEnabledIPListContainsIP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledIPListContainsIPRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).FindEnabledIPListContainsIP(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/FindEnabledIPListContainsIP", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).FindEnabledIPListContainsIP(ctx, req.(*FindEnabledIPListContainsIPRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _IPListService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.IPListService", HandlerType: (*IPListServiceServer)(nil), @@ -1300,6 +1473,10 @@ var _IPListService_serviceDesc = grpc.ServiceDesc{ MethodName: "existsEnabledIPList", Handler: _IPListService_ExistsEnabledIPList_Handler, }, + { + MethodName: "findEnabledIPListContainsIP", + Handler: _IPListService_FindEnabledIPListContainsIP_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_ip_list.proto", diff --git a/pkg/rpc/protos/service_ip_item.proto b/pkg/rpc/protos/service_ip_item.proto index 064fed4..2ad1cd3 100644 --- a/pkg/rpc/protos/service_ip_item.proto +++ b/pkg/rpc/protos/service_ip_item.proto @@ -123,4 +123,6 @@ message ExistsEnabledIPItemRequest { message ExistsEnabledIPItemResponse { bool exists = 1; -} \ No newline at end of file +} + +// \ No newline at end of file diff --git a/pkg/rpc/protos/service_ip_list.proto b/pkg/rpc/protos/service_ip_list.proto index 3706760..65c967d 100644 --- a/pkg/rpc/protos/service_ip_list.proto +++ b/pkg/rpc/protos/service_ip_list.proto @@ -28,6 +28,9 @@ service IPListService { // 检查IPList是否存在 rpc existsEnabledIPList (ExistsEnabledIPListRequest) returns (ExistsEnabledIPListResponse); + + // 根据IP来搜索IP名单 + rpc findEnabledIPListContainsIP(FindEnabledIPListContainsIPRequest) returns (FindEnabledIPListContainsIPResponse); } // 创建IP列表 @@ -94,4 +97,13 @@ message ExistsEnabledIPListRequest { message ExistsEnabledIPListResponse { bool exists = 1; +} + +// 根据IP来搜索IP名单 +message FindEnabledIPListContainsIPRequest { + string ip = 1; +} + +message FindEnabledIPListContainsIPResponse { + repeated IPList ipLists = 1; } \ No newline at end of file