From d75a28a0167646d6df855f2fbd30b2bf99a06952 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 17 Nov 2021 20:25:40 +0800 Subject: [PATCH] =?UTF-8?q?IP=E5=90=8D=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8F=AA=E6=98=BE=E7=A4=BA=E8=87=AA=E5=8A=A8=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E5=90=8D=E5=8D=95=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/rpc/pb/service_ip_item.pb.go | 38 +++++++++++++++++++++------- pkg/rpc/protos/service_ip_item.proto | 6 +++-- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/pkg/rpc/pb/service_ip_item.pb.go b/pkg/rpc/pb/service_ip_item.pb.go index 30f8f7f..5b77117 100644 --- a/pkg/rpc/pb/service_ip_item.pb.go +++ b/pkg/rpc/pb/service_ip_item.pb.go @@ -1013,7 +1013,8 @@ type CountAllEnabledIPItemsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"` } func (x *CountAllEnabledIPItemsRequest) Reset() { @@ -1055,15 +1056,23 @@ func (x *CountAllEnabledIPItemsRequest) GetIp() string { return "" } +func (x *CountAllEnabledIPItemsRequest) GetGlobalOnly() bool { + if x != nil { + return x.GlobalOnly + } + return false +} + // 列出所有名单中的IP type ListAllEnabledIPItemsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` - Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` + GlobalOnly bool `protobuf:"varint,2,opt,name=globalOnly,proto3" json:"globalOnly,omitempty"` + Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` } func (x *ListAllEnabledIPItemsRequest) Reset() { @@ -1105,6 +1114,13 @@ func (x *ListAllEnabledIPItemsRequest) GetIp() string { return "" } +func (x *ListAllEnabledIPItemsRequest) GetGlobalOnly() bool { + if x != nil { + return x.GlobalOnly + } + return false +} + func (x *ListAllEnabledIPItemsRequest) GetOffset() int64 { if x != nil { return x.Offset @@ -1365,16 +1381,20 @@ var file_service_ip_item_proto_rawDesc = []byte{ 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, 0x22, 0x2f, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x1d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x22, - 0x5a, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, + 0x1e, 0x0a, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x22, + 0x7a, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x1e, 0x0a, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x4f, 0x6e, 0x6c, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x1d, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, diff --git a/pkg/rpc/protos/service_ip_item.proto b/pkg/rpc/protos/service_ip_item.proto index 27de15a..f3d51ec 100644 --- a/pkg/rpc/protos/service_ip_item.proto +++ b/pkg/rpc/protos/service_ip_item.proto @@ -152,13 +152,15 @@ message ExistsEnabledIPItemResponse { // 计算所有IP数量 message CountAllEnabledIPItemsRequest { string ip = 1; + bool globalOnly = 2; } // 列出所有名单中的IP message ListAllEnabledIPItemsRequest { string ip = 1; - int64 offset = 2; - int64 size = 3; + bool globalOnly = 2; + int64 offset = 3; + int64 size = 4; } message ListAllEnabledIPItemsResponse {