实现公用的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

@@ -39,6 +39,8 @@ type CreateIPListRequest struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
TimeoutJSON []byte `protobuf:"bytes,4,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"`
IsPublic bool `protobuf:"varint,5,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *CreateIPListRequest) Reset() {
@@ -101,6 +103,20 @@ func (x *CreateIPListRequest) GetTimeoutJSON() []byte {
return nil
}
func (x *CreateIPListRequest) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *CreateIPListRequest) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
type CreateIPListResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -158,6 +174,7 @@ type UpdateIPListRequest struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
TimeoutJSON []byte `protobuf:"bytes,4,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *UpdateIPListRequest) Reset() {
@@ -220,7 +237,14 @@ func (x *UpdateIPListRequest) GetTimeoutJSON() []byte {
return nil
}
// 查找IP列表
func (x *UpdateIPListRequest) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
// 查找IP列表信息
type FindEnabledIPListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -315,6 +339,340 @@ func (x *FindEnabledIPListResponse) GetIpList() *IPList {
return nil
}
// 计算名单数量
type CountAllEnabledIPListsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
IsPublic bool `protobuf:"varint,2,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"`
}
func (x *CountAllEnabledIPListsRequest) Reset() {
*x = CountAllEnabledIPListsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CountAllEnabledIPListsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CountAllEnabledIPListsRequest) ProtoMessage() {}
func (x *CountAllEnabledIPListsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_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 CountAllEnabledIPListsRequest.ProtoReflect.Descriptor instead.
func (*CountAllEnabledIPListsRequest) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{5}
}
func (x *CountAllEnabledIPListsRequest) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *CountAllEnabledIPListsRequest) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *CountAllEnabledIPListsRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
// 列出单页名单
type ListEnabledIPListsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
IsPublic bool `protobuf:"varint,2,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"`
Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
Size int64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"`
}
func (x *ListEnabledIPListsRequest) Reset() {
*x = ListEnabledIPListsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListEnabledIPListsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListEnabledIPListsRequest) ProtoMessage() {}
func (x *ListEnabledIPListsRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_proto_msgTypes[6]
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 ListEnabledIPListsRequest.ProtoReflect.Descriptor instead.
func (*ListEnabledIPListsRequest) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{6}
}
func (x *ListEnabledIPListsRequest) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *ListEnabledIPListsRequest) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *ListEnabledIPListsRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
func (x *ListEnabledIPListsRequest) GetOffset() int64 {
if x != nil {
return x.Offset
}
return 0
}
func (x *ListEnabledIPListsRequest) GetSize() int64 {
if x != nil {
return x.Size
}
return 0
}
type ListEnabledIPListsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpLists []*IPList `protobuf:"bytes,1,rep,name=ipLists,proto3" json:"ipLists,omitempty"`
}
func (x *ListEnabledIPListsResponse) Reset() {
*x = ListEnabledIPListsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListEnabledIPListsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListEnabledIPListsResponse) ProtoMessage() {}
func (x *ListEnabledIPListsResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_proto_msgTypes[7]
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 ListEnabledIPListsResponse.ProtoReflect.Descriptor instead.
func (*ListEnabledIPListsResponse) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{7}
}
func (x *ListEnabledIPListsResponse) GetIpLists() []*IPList {
if x != nil {
return x.IpLists
}
return nil
}
// 删除IP名单
type DeleteIPListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"`
}
func (x *DeleteIPListRequest) Reset() {
*x = DeleteIPListRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteIPListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteIPListRequest) ProtoMessage() {}
func (x *DeleteIPListRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_proto_msgTypes[8]
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 DeleteIPListRequest.ProtoReflect.Descriptor instead.
func (*DeleteIPListRequest) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{8}
}
func (x *DeleteIPListRequest) GetIpListId() int64 {
if x != nil {
return x.IpListId
}
return 0
}
// 检查IPList是否存在
type ExistsEnabledIPListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"`
}
func (x *ExistsEnabledIPListRequest) Reset() {
*x = ExistsEnabledIPListRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExistsEnabledIPListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExistsEnabledIPListRequest) ProtoMessage() {}
func (x *ExistsEnabledIPListRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_proto_msgTypes[9]
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 ExistsEnabledIPListRequest.ProtoReflect.Descriptor instead.
func (*ExistsEnabledIPListRequest) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{9}
}
func (x *ExistsEnabledIPListRequest) GetIpListId() int64 {
if x != nil {
return x.IpListId
}
return 0
}
type ExistsEnabledIPListResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"`
}
func (x *ExistsEnabledIPListResponse) Reset() {
*x = ExistsEnabledIPListResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_service_ip_list_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExistsEnabledIPListResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExistsEnabledIPListResponse) ProtoMessage() {}
func (x *ExistsEnabledIPListResponse) ProtoReflect() protoreflect.Message {
mi := &file_service_ip_list_proto_msgTypes[10]
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 ExistsEnabledIPListResponse.ProtoReflect.Descriptor instead.
func (*ExistsEnabledIPListResponse) Descriptor() ([]byte, []int) {
return file_service_ip_list_proto_rawDescGZIP(), []int{10}
}
func (x *ExistsEnabledIPListResponse) GetExists() bool {
if x != nil {
return x.Exists
}
return false
}
var File_service_ip_list_proto protoreflect.FileDescriptor
var file_service_ip_list_proto_rawDesc = []byte{
@@ -323,17 +681,21 @@ var file_service_ip_list_proto_rawDesc = []byte{
0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d,
0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x73, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65,
0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x22, 0x7b, 0x0a, 0x13, 0x55,
0x74, 0x6f, 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79,
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d,
0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x22, 0x9d, 0x01, 0x0a, 0x13, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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, 0x12,
@@ -341,30 +703,82 @@ var file_service_ip_list_proto_rawDesc = []byte{
0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d,
0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69, 0x6e, 0x64,
0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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,
0x22, 0x3f, 0x0a, 0x19, 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, 0x22, 0x0a,
0x06, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x06, 0x69, 0x70, 0x4c, 0x69, 0x73,
0x74, 0x32, 0xdd, 0x01, 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,
0x65, 0x6f, 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63,
0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x18, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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, 0x22, 0x3f, 0x0a, 0x19, 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,
0x22, 0x0a, 0x06, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x06, 0x69, 0x70, 0x4c,
0x69, 0x73, 0x74, 0x22, 0x69, 0x0a, 0x1d, 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, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x91,
0x01, 0x0a, 0x19, 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, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01,
0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07,
0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b,
0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12,
0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69,
0x7a, 0x65, 0x22, 0x42, 0x0a, 0x1a, 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, 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, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 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, 0x22, 0x38, 0x0a, 0x1a, 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, 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, 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,
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,
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,
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, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
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,
}
var (
@@ -379,29 +793,45 @@ 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, 5)
var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
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
(*IPList)(nil), // 5: pb.IPList
(*RPCSuccess)(nil), // 6: pb.RPCSuccess
(*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
}
var file_service_ip_list_proto_depIdxs = []int32{
5, // 0: pb.FindEnabledIPListResponse.ipList:type_name -> pb.IPList
0, // 1: pb.IPListService.createIPList:input_type -> pb.CreateIPListRequest
2, // 2: pb.IPListService.updateIPList:input_type -> pb.UpdateIPListRequest
3, // 3: pb.IPListService.findEnabledIPList:input_type -> pb.FindEnabledIPListRequest
1, // 4: pb.IPListService.createIPList:output_type -> pb.CreateIPListResponse
6, // 5: pb.IPListService.updateIPList:output_type -> pb.RPCSuccess
4, // 6: pb.IPListService.findEnabledIPList:output_type -> pb.FindEnabledIPListResponse
4, // [4:7] is the sub-list for method output_type
1, // [1:4] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
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
}
func init() { file_service_ip_list_proto_init() }
@@ -472,6 +902,78 @@ func file_service_ip_list_proto_init() {
return nil
}
}
file_service_ip_list_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CountAllEnabledIPListsRequest); 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[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListEnabledIPListsRequest); 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[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListEnabledIPListsResponse); 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[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteIPListRequest); 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[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExistsEnabledIPListRequest); 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[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExistsEnabledIPListResponse); 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{
@@ -479,7 +981,7 @@ func file_service_ip_list_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_ip_list_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
@@ -509,8 +1011,16 @@ type IPListServiceClient interface {
CreateIPList(ctx context.Context, in *CreateIPListRequest, opts ...grpc.CallOption) (*CreateIPListResponse, error)
// 修改IP列表
UpdateIPList(ctx context.Context, in *UpdateIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查找IP列表
// 查找IP列表信息
FindEnabledIPList(ctx context.Context, in *FindEnabledIPListRequest, opts ...grpc.CallOption) (*FindEnabledIPListResponse, error)
// 计算名单数量
CountAllEnabledIPLists(ctx context.Context, in *CountAllEnabledIPListsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 列出单页名单
ListEnabledIPLists(ctx context.Context, in *ListEnabledIPListsRequest, opts ...grpc.CallOption) (*ListEnabledIPListsResponse, error)
// 删除IP名单
DeleteIPList(ctx context.Context, in *DeleteIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 检查IPList是否存在
ExistsEnabledIPList(ctx context.Context, in *ExistsEnabledIPListRequest, opts ...grpc.CallOption) (*ExistsEnabledIPListResponse, error)
}
type iPListServiceClient struct {
@@ -548,14 +1058,58 @@ func (c *iPListServiceClient) FindEnabledIPList(ctx context.Context, in *FindEna
return out, nil
}
func (c *iPListServiceClient) CountAllEnabledIPLists(ctx context.Context, in *CountAllEnabledIPListsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
out := new(RPCCountResponse)
err := c.cc.Invoke(ctx, "/pb.IPListService/countAllEnabledIPLists", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iPListServiceClient) ListEnabledIPLists(ctx context.Context, in *ListEnabledIPListsRequest, opts ...grpc.CallOption) (*ListEnabledIPListsResponse, error) {
out := new(ListEnabledIPListsResponse)
err := c.cc.Invoke(ctx, "/pb.IPListService/listEnabledIPLists", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iPListServiceClient) DeleteIPList(ctx context.Context, in *DeleteIPListRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.IPListService/deleteIPList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iPListServiceClient) ExistsEnabledIPList(ctx context.Context, in *ExistsEnabledIPListRequest, opts ...grpc.CallOption) (*ExistsEnabledIPListResponse, error) {
out := new(ExistsEnabledIPListResponse)
err := c.cc.Invoke(ctx, "/pb.IPListService/existsEnabledIPList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// IPListServiceServer is the server API for IPListService service.
type IPListServiceServer interface {
// 创建IP列表
CreateIPList(context.Context, *CreateIPListRequest) (*CreateIPListResponse, error)
// 修改IP列表
UpdateIPList(context.Context, *UpdateIPListRequest) (*RPCSuccess, error)
// 查找IP列表
// 查找IP列表信息
FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error)
// 计算名单数量
CountAllEnabledIPLists(context.Context, *CountAllEnabledIPListsRequest) (*RPCCountResponse, error)
// 列出单页名单
ListEnabledIPLists(context.Context, *ListEnabledIPListsRequest) (*ListEnabledIPListsResponse, error)
// 删除IP名单
DeleteIPList(context.Context, *DeleteIPListRequest) (*RPCSuccess, error)
// 检查IPList是否存在
ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error)
}
// UnimplementedIPListServiceServer can be embedded to have forward compatible implementations.
@@ -571,6 +1125,18 @@ func (*UnimplementedIPListServiceServer) UpdateIPList(context.Context, *UpdateIP
func (*UnimplementedIPListServiceServer) FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPList not implemented")
}
func (*UnimplementedIPListServiceServer) CountAllEnabledIPLists(context.Context, *CountAllEnabledIPListsRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledIPLists not implemented")
}
func (*UnimplementedIPListServiceServer) ListEnabledIPLists(context.Context, *ListEnabledIPListsRequest) (*ListEnabledIPListsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListEnabledIPLists not implemented")
}
func (*UnimplementedIPListServiceServer) DeleteIPList(context.Context, *DeleteIPListRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteIPList not implemented")
}
func (*UnimplementedIPListServiceServer) ExistsEnabledIPList(context.Context, *ExistsEnabledIPListRequest) (*ExistsEnabledIPListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExistsEnabledIPList not implemented")
}
func RegisterIPListServiceServer(s *grpc.Server, srv IPListServiceServer) {
s.RegisterService(&_IPListService_serviceDesc, srv)
@@ -630,6 +1196,78 @@ func _IPListService_FindEnabledIPList_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
func _IPListService_CountAllEnabledIPLists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountAllEnabledIPListsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPListServiceServer).CountAllEnabledIPLists(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPListService/CountAllEnabledIPLists",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPListServiceServer).CountAllEnabledIPLists(ctx, req.(*CountAllEnabledIPListsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IPListService_ListEnabledIPLists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListEnabledIPListsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPListServiceServer).ListEnabledIPLists(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPListService/ListEnabledIPLists",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPListServiceServer).ListEnabledIPLists(ctx, req.(*ListEnabledIPListsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IPListService_DeleteIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteIPListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPListServiceServer).DeleteIPList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPListService/DeleteIPList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPListServiceServer).DeleteIPList(ctx, req.(*DeleteIPListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IPListService_ExistsEnabledIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExistsEnabledIPListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IPListServiceServer).ExistsEnabledIPList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.IPListService/ExistsEnabledIPList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IPListServiceServer).ExistsEnabledIPList(ctx, req.(*ExistsEnabledIPListRequest))
}
return interceptor(ctx, in, info, handler)
}
var _IPListService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.IPListService",
HandlerType: (*IPListServiceServer)(nil),
@@ -646,6 +1284,22 @@ var _IPListService_serviceDesc = grpc.ServiceDesc{
MethodName: "findEnabledIPList",
Handler: _IPListService_FindEnabledIPList_Handler,
},
{
MethodName: "countAllEnabledIPLists",
Handler: _IPListService_CountAllEnabledIPLists_Handler,
},
{
MethodName: "listEnabledIPLists",
Handler: _IPListService_ListEnabledIPLists_Handler,
},
{
MethodName: "deleteIPList",
Handler: _IPListService_DeleteIPList_Handler,
},
{
MethodName: "existsEnabledIPList",
Handler: _IPListService_ExistsEnabledIPList_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_ip_list.proto",