实现公用的IP名单

This commit is contained in:
GoEdgeLab
2021-06-23 13:13:58 +08:00
parent 7ef3373d4e
commit 14ae8dbaa1
7 changed files with 1367 additions and 129 deletions

View File

@@ -673,6 +673,236 @@ func (x *ListIPItemsAfterVersionResponse) GetIpItems() []*IPItem {
return nil
}
// 检查IP状态
type CheckIPItemStatusRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"`
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
}
func (x *CheckIPItemStatusRequest) Reset() {
*x = CheckIPItemStatusRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_item_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckIPItemStatusRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckIPItemStatusRequest) ProtoMessage() {}
func (x *CheckIPItemStatusRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_item_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 CheckIPItemStatusRequest.ProtoReflect.Descriptor instead.
func (*CheckIPItemStatusRequest) Descriptor() ([]byte, []int) {
return file_service_ip_item_proto_rawDescGZIP(), []int{11}
}
func (x *CheckIPItemStatusRequest) GetIpListId() int64 {
if x != nil {
return x.IpListId
}
return 0
}
func (x *CheckIPItemStatusRequest) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
type CheckIPItemStatusResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IsOk bool `protobuf:"varint,1,opt,name=isOk,proto3" json:"isOk,omitempty"` // 是否查询成功
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
IsFound bool `protobuf:"varint,3,opt,name=isFound,proto3" json:"isFound,omitempty"` // 是否找到
IsAllowed bool `protobuf:"varint,4,opt,name=isAllowed,proto3" json:"isAllowed,omitempty"` // 是否允许
IpItem *IPItem `protobuf:"bytes,5,opt,name=ipItem,proto3" json:"ipItem,omitempty"` // 匹配的IPItem
}
func (x *CheckIPItemStatusResponse) Reset() {
*x = CheckIPItemStatusResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_item_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CheckIPItemStatusResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CheckIPItemStatusResponse) ProtoMessage() {}
func (x *CheckIPItemStatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_item_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 CheckIPItemStatusResponse.ProtoReflect.Descriptor instead.
func (*CheckIPItemStatusResponse) Descriptor() ([]byte, []int) {
return file_service_ip_item_proto_rawDescGZIP(), []int{12}
}
func (x *CheckIPItemStatusResponse) GetIsOk() bool {
if x != nil {
return x.IsOk
}
return false
}
func (x *CheckIPItemStatusResponse) GetError() string {
if x != nil {
return x.Error
}
return ""
}
func (x *CheckIPItemStatusResponse) GetIsFound() bool {
if x != nil {
return x.IsFound
}
return false
}
func (x *CheckIPItemStatusResponse) GetIsAllowed() bool {
if x != nil {
return x.IsAllowed
}
return false
}
func (x *CheckIPItemStatusResponse) GetIpItem() *IPItem {
if x != nil {
return x.IpItem
}
return nil
}
// 检查IP是否存在
type ExistsEnabledIPItemRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"`
}
func (x *ExistsEnabledIPItemRequest) Reset() {
*x = ExistsEnabledIPItemRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_item_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExistsEnabledIPItemRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExistsEnabledIPItemRequest) ProtoMessage() {}
func (x *ExistsEnabledIPItemRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_item_proto_msgTypes[13]
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 ExistsEnabledIPItemRequest.ProtoReflect.Descriptor instead.
func (*ExistsEnabledIPItemRequest) Descriptor() ([]byte, []int) {
return file_service_ip_item_proto_rawDescGZIP(), []int{13}
}
func (x *ExistsEnabledIPItemRequest) GetIpItemId() int64 {
if x != nil {
return x.IpItemId
}
return 0
}
type ExistsEnabledIPItemResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
}
func (x *ExistsEnabledIPItemResponse) Reset() {
*x = ExistsEnabledIPItemResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_item_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExistsEnabledIPItemResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExistsEnabledIPItemResponse) ProtoMessage() {}
func (x *ExistsEnabledIPItemResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_item_proto_msgTypes[14]
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 ExistsEnabledIPItemResponse.ProtoReflect.Descriptor instead.
func (*ExistsEnabledIPItemResponse) Descriptor() ([]byte, []int) {
return file_service_ip_item_proto_rawDescGZIP(), []int{14}
}
func (x *ExistsEnabledIPItemResponse) GetExists() bool {
if x != nil {
return x.Exists
}
return false
}
var File_service_ip_item_proto protoreflect.FileDescriptor
var file_service_ip_item_proto_rawDesc = []byte{
@@ -744,43 +974,75 @@ var file_service_ip_item_proto_rawDesc = []byte{
0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x49, 0x74,
0x65, 0x6d, 0x52, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x32, 0xab, 0x04, 0x0a, 0x0d,
0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a,
0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x37, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d,
0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74,
0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x64, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x51, 0x0a, 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69,
0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 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, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x20,
0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57,
0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 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, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50,
0x49, 0x74, 0x65, 0x6d, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x6d, 0x52, 0x07, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x46, 0x0a, 0x18, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73,
0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x4c, 0x69, 0x73,
0x74, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x02, 0x69, 0x70, 0x22, 0xa1, 0x01, 0x0a, 0x19, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49,
0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x73, 0x4f, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x69,
0x73, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73,
0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77,
0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f,
0x77, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52,
0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x38, 0x0a, 0x1a, 0x45, 0x78, 0x69, 0x73, 0x74,
0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x22, 0x35, 0x0a, 0x1b, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 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, 0xd5, 0x05, 0x0a, 0x0d, 0x49, 0x50, 0x49,
0x74, 0x65, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x63, 0x72,
0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49,
0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a,
0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12,
0x51, 0x0a, 0x16, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57,
0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68, 0x4c,
0x69, 0x73, 0x74, 0x49, 0x64, 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, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x57, 0x69, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69, 0x74, 0x68,
0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e,
0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x57, 0x69,
0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x50, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49,
0x50, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 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, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d,
0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e,
0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x41, 0x66,
0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x50, 0x49, 0x74, 0x65,
0x6d, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x49,
0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x62,
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x65, 0x78, 0x69, 0x73,
0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x12,
0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 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, 0x49, 0x74, 0x65, 0x6d, 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 (
@@ -795,7 +1057,7 @@ func file_service_ip_item_proto_rawDescGZIP() []byte {
return file_service_ip_item_proto_rawDescData
}
var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_service_ip_item_proto_goTypes = []interface{}{
(*CreateIPItemRequest)(nil), // 0: pb.CreateIPItemRequest
(*CreateIPItemResponse)(nil), // 1: pb.CreateIPItemResponse
@@ -808,33 +1070,42 @@ var file_service_ip_item_proto_goTypes = []interface{}{
(*FindEnabledIPItemResponse)(nil), // 8: pb.FindEnabledIPItemResponse
(*ListIPItemsAfterVersionRequest)(nil), // 9: pb.ListIPItemsAfterVersionRequest
(*ListIPItemsAfterVersionResponse)(nil), // 10: pb.ListIPItemsAfterVersionResponse
(*IPItem)(nil), // 11: pb.IPItem
(*RPCSuccess)(nil), // 12: pb.RPCSuccess
(*RPCCountResponse)(nil), // 13: pb.RPCCountResponse
(*CheckIPItemStatusRequest)(nil), // 11: pb.CheckIPItemStatusRequest
(*CheckIPItemStatusResponse)(nil), // 12: pb.CheckIPItemStatusResponse
(*ExistsEnabledIPItemRequest)(nil), // 13: pb.ExistsEnabledIPItemRequest
(*ExistsEnabledIPItemResponse)(nil), // 14: pb.ExistsEnabledIPItemResponse
(*IPItem)(nil), // 15: pb.IPItem
(*RPCSuccess)(nil), // 16: pb.RPCSuccess
(*RPCCountResponse)(nil), // 17: pb.RPCCountResponse
}
var file_service_ip_item_proto_depIdxs = []int32{
11, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem
11, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem
11, // 2: pb.ListIPItemsAfterVersionResponse.ipItems:type_name -> pb.IPItem
0, // 3: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest
2, // 4: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest
3, // 5: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest
4, // 6: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest
5, // 7: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest
7, // 8: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest
9, // 9: pb.IPItemService.listIPItemsAfterVersion:input_type -> pb.ListIPItemsAfterVersionRequest
1, // 10: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse
12, // 11: pb.IPItemService.updateIPItem:output_type -> pb.RPCSuccess
12, // 12: pb.IPItemService.deleteIPItem:output_type -> pb.RPCSuccess
13, // 13: pb.IPItemService.countIPItemsWithListId:output_type -> pb.RPCCountResponse
6, // 14: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse
8, // 15: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse
10, // 16: pb.IPItemService.listIPItemsAfterVersion:output_type -> pb.ListIPItemsAfterVersionResponse
10, // [10:17] is the sub-list for method output_type
3, // [3:10] 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
15, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem
15, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem
15, // 2: pb.ListIPItemsAfterVersionResponse.ipItems:type_name -> pb.IPItem
15, // 3: pb.CheckIPItemStatusResponse.ipItem:type_name -> pb.IPItem
0, // 4: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest
2, // 5: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest
3, // 6: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest
4, // 7: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest
5, // 8: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest
7, // 9: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest
9, // 10: pb.IPItemService.listIPItemsAfterVersion:input_type -> pb.ListIPItemsAfterVersionRequest
11, // 11: pb.IPItemService.checkIPItemStatus:input_type -> pb.CheckIPItemStatusRequest
13, // 12: pb.IPItemService.existsEnabledIPItem:input_type -> pb.ExistsEnabledIPItemRequest
1, // 13: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse
16, // 14: pb.IPItemService.updateIPItem:output_type -> pb.RPCSuccess
16, // 15: pb.IPItemService.deleteIPItem:output_type -> pb.RPCSuccess
17, // 16: pb.IPItemService.countIPItemsWithListId:output_type -> pb.RPCCountResponse
6, // 17: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse
8, // 18: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse
10, // 19: pb.IPItemService.listIPItemsAfterVersion:output_type -> pb.ListIPItemsAfterVersionResponse
12, // 20: pb.IPItemService.checkIPItemStatus:output_type -> pb.CheckIPItemStatusResponse
14, // 21: pb.IPItemService.existsEnabledIPItem:output_type -> pb.ExistsEnabledIPItemResponse
13, // [13:22] is the sub-list for method output_type
4, // [4:13] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_service_ip_item_proto_init() }
@@ -977,6 +1248,54 @@ func file_service_ip_item_proto_init() {
return nil
}
}
file_service_ip_item_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckIPItemStatusRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_ip_item_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CheckIPItemStatusResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_ip_item_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExistsEnabledIPItemRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_service_ip_item_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExistsEnabledIPItemResponse); 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{
@@ -984,7 +1303,7 @@ func file_service_ip_item_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_ip_item_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumMessages: 15,
NumExtensions: 0,
NumServices: 1,
},
@@ -1024,6 +1343,10 @@ type IPItemServiceClient interface {
FindEnabledIPItem(ctx context.Context, in *FindEnabledIPItemRequest, opts ...grpc.CallOption) (*FindEnabledIPItemResponse, error)
// 根据版本列出一组IP
ListIPItemsAfterVersion(ctx context.Context, in *ListIPItemsAfterVersionRequest, opts ...grpc.CallOption) (*ListIPItemsAfterVersionResponse, error)
// 检查IP状态
CheckIPItemStatus(ctx context.Context, in *CheckIPItemStatusRequest, opts ...grpc.CallOption) (*CheckIPItemStatusResponse, error)
// 检查IP是否存在
ExistsEnabledIPItem(ctx context.Context, in *ExistsEnabledIPItemRequest, opts ...grpc.CallOption) (*ExistsEnabledIPItemResponse, error)
}
type iPItemServiceClient struct {
@@ -1097,6 +1420,24 @@ func (c *iPItemServiceClient) ListIPItemsAfterVersion(ctx context.Context, in *L
return out, nil
}
func (c *iPItemServiceClient) CheckIPItemStatus(ctx context.Context, in *CheckIPItemStatusRequest, opts ...grpc.CallOption) (*CheckIPItemStatusResponse, error) {
out := new(CheckIPItemStatusResponse)
err := c.cc.Invoke(ctx, "/pb.IPItemService/checkIPItemStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iPItemServiceClient) ExistsEnabledIPItem(ctx context.Context, in *ExistsEnabledIPItemRequest, opts ...grpc.CallOption) (*ExistsEnabledIPItemResponse, error) {
out := new(ExistsEnabledIPItemResponse)
err := c.cc.Invoke(ctx, "/pb.IPItemService/existsEnabledIPItem", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// IPItemServiceServer is the server API for IPItemService service.
type IPItemServiceServer interface {
// 创建IP
@@ -1113,6 +1454,10 @@ type IPItemServiceServer interface {
FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error)
// 根据版本列出一组IP
ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error)
// 检查IP状态
CheckIPItemStatus(context.Context, *CheckIPItemStatusRequest) (*CheckIPItemStatusResponse, error)
// 检查IP是否存在
ExistsEnabledIPItem(context.Context, *ExistsEnabledIPItemRequest) (*ExistsEnabledIPItemResponse, error)
}
// UnimplementedIPItemServiceServer can be embedded to have forward compatible implementations.
@@ -1140,6 +1485,12 @@ func (*UnimplementedIPItemServiceServer) FindEnabledIPItem(context.Context, *Fin
func (*UnimplementedIPItemServiceServer) ListIPItemsAfterVersion(context.Context, *ListIPItemsAfterVersionRequest) (*ListIPItemsAfterVersionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListIPItemsAfterVersion not implemented")
}
func (*UnimplementedIPItemServiceServer) CheckIPItemStatus(context.Context, *CheckIPItemStatusRequest) (*CheckIPItemStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckIPItemStatus not implemented")
}
func (*UnimplementedIPItemServiceServer) ExistsEnabledIPItem(context.Context, *ExistsEnabledIPItemRequest) (*ExistsEnabledIPItemResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExistsEnabledIPItem not implemented")
}
func RegisterIPItemServiceServer(s *grpc.Server, srv IPItemServiceServer) {
s.RegisterService(&_IPItemService_serviceDesc, srv)
@@ -1271,6 +1622,42 @@ func _IPItemService_ListIPItemsAfterVersion_Handler(srv interface{}, ctx context
return interceptor(ctx, in, info, handler)
}
func _IPItemService_CheckIPItemStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckIPItemStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPItemServiceServer).CheckIPItemStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPItemService/CheckIPItemStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPItemServiceServer).CheckIPItemStatus(ctx, req.(*CheckIPItemStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IPItemService_ExistsEnabledIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExistsEnabledIPItemRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPItemServiceServer).ExistsEnabledIPItem(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPItemService/ExistsEnabledIPItem",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPItemServiceServer).ExistsEnabledIPItem(ctx, req.(*ExistsEnabledIPItemRequest))
}
return interceptor(ctx, in, info, handler)
}
var _IPItemService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.IPItemService",
HandlerType: (*IPItemServiceServer)(nil),
@@ -1303,6 +1690,14 @@ var _IPItemService_serviceDesc = grpc.ServiceDesc{
MethodName: "listIPItemsAfterVersion",
Handler: _IPItemService_ListIPItemsAfterVersion_Handler,
},
{
MethodName: "checkIPItemStatus",
Handler: _IPItemService_CheckIPItemStatus_Handler,
},
{
MethodName: "existsEnabledIPItem",
Handler: _IPItemService_ExistsEnabledIPItem_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_ip_item.proto",