diff --git a/pkg/rpc/pb/model_ip_item.pb.go b/pkg/rpc/pb/model_ip_item.pb.go new file mode 100644 index 0000000..a256c0c --- /dev/null +++ b/pkg/rpc/pb/model_ip_item.pb.go @@ -0,0 +1,193 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: model_ip_item.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type IPItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"` + IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"` + Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` + ExpiredAt int64 `protobuf:"varint,5,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` + Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *IPItem) Reset() { + *x = IPItem{} + if protoimpl.UnsafeEnabled { + mi := &file_model_ip_item_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPItem) ProtoMessage() {} + +func (x *IPItem) ProtoReflect() protoreflect.Message { + mi := &file_model_ip_item_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IPItem.ProtoReflect.Descriptor instead. +func (*IPItem) Descriptor() ([]byte, []int) { + return file_model_ip_item_proto_rawDescGZIP(), []int{0} +} + +func (x *IPItem) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *IPItem) GetIpFrom() string { + if x != nil { + return x.IpFrom + } + return "" +} + +func (x *IPItem) GetIpTo() string { + if x != nil { + return x.IpTo + } + return "" +} + +func (x *IPItem) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *IPItem) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *IPItem) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +var File_model_ip_item_proto protoreflect.FileDescriptor + +var file_model_ip_item_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x94, 0x01, 0x0a, 0x06, 0x49, 0x50, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x70, 0x54, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x70, 0x54, 0x6f, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_model_ip_item_proto_rawDescOnce sync.Once + file_model_ip_item_proto_rawDescData = file_model_ip_item_proto_rawDesc +) + +func file_model_ip_item_proto_rawDescGZIP() []byte { + file_model_ip_item_proto_rawDescOnce.Do(func() { + file_model_ip_item_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_ip_item_proto_rawDescData) + }) + return file_model_ip_item_proto_rawDescData +} + +var file_model_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_ip_item_proto_goTypes = []interface{}{ + (*IPItem)(nil), // 0: pb.IPItem +} +var file_model_ip_item_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_model_ip_item_proto_init() } +func file_model_ip_item_proto_init() { + if File_model_ip_item_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_ip_item_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IPItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_ip_item_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_ip_item_proto_goTypes, + DependencyIndexes: file_model_ip_item_proto_depIdxs, + MessageInfos: file_model_ip_item_proto_msgTypes, + }.Build() + File_model_ip_item_proto = out.File + file_model_ip_item_proto_rawDesc = nil + file_model_ip_item_proto_goTypes = nil + file_model_ip_item_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/model_ip_list.pb.go b/pkg/rpc/pb/model_ip_list.pb.go new file mode 100644 index 0000000..75d621f --- /dev/null +++ b/pkg/rpc/pb/model_ip_list.pb.go @@ -0,0 +1,193 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: model_ip_list.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type IPList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Code string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"` + TimeoutJSON []byte `protobuf:"bytes,6,opt,name=timeoutJSON,proto3" json:"timeoutJSON,omitempty"` +} + +func (x *IPList) Reset() { + *x = IPList{} + if protoimpl.UnsafeEnabled { + mi := &file_model_ip_list_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IPList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IPList) ProtoMessage() {} + +func (x *IPList) ProtoReflect() protoreflect.Message { + mi := &file_model_ip_list_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IPList.ProtoReflect.Descriptor instead. +func (*IPList) Descriptor() ([]byte, []int) { + return file_model_ip_list_proto_rawDescGZIP(), []int{0} +} + +func (x *IPList) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *IPList) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *IPList) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *IPList) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *IPList) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *IPList) GetTimeoutJSON() []byte { + if x != nil { + return x.TimeoutJSON + } + return nil +} + +var File_model_ip_list_proto protoreflect.FileDescriptor + +var file_model_ip_list_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x49, 0x50, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x05, 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, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_model_ip_list_proto_rawDescOnce sync.Once + file_model_ip_list_proto_rawDescData = file_model_ip_list_proto_rawDesc +) + +func file_model_ip_list_proto_rawDescGZIP() []byte { + file_model_ip_list_proto_rawDescOnce.Do(func() { + file_model_ip_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_ip_list_proto_rawDescData) + }) + return file_model_ip_list_proto_rawDescData +} + +var file_model_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_ip_list_proto_goTypes = []interface{}{ + (*IPList)(nil), // 0: pb.IPList +} +var file_model_ip_list_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_model_ip_list_proto_init() } +func file_model_ip_list_proto_init() { + if File_model_ip_list_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_ip_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IPList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_ip_list_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_ip_list_proto_goTypes, + DependencyIndexes: file_model_ip_list_proto_depIdxs, + MessageInfos: file_model_ip_list_proto_msgTypes, + }.Build() + File_model_ip_list_proto = out.File + file_model_ip_list_proto_rawDesc = nil + file_model_ip_list_proto_goTypes = nil + file_model_ip_list_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_ip_item.pb.go b/pkg/rpc/pb/service_ip_item.pb.go new file mode 100644 index 0000000..1f22905 --- /dev/null +++ b/pkg/rpc/pb/service_ip_item.pb.go @@ -0,0 +1,1149 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_ip_item.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// 创建IP +type CreateIPItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` + IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"` + IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"` + ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` + Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *CreateIPItemRequest) Reset() { + *x = CreateIPItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIPItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIPItemRequest) ProtoMessage() {} + +func (x *CreateIPItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIPItemRequest.ProtoReflect.Descriptor instead. +func (*CreateIPItemRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateIPItemRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +func (x *CreateIPItemRequest) GetIpFrom() string { + if x != nil { + return x.IpFrom + } + return "" +} + +func (x *CreateIPItemRequest) GetIpTo() string { + if x != nil { + return x.IpTo + } + return "" +} + +func (x *CreateIPItemRequest) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *CreateIPItemRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type CreateIPItemResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"` +} + +func (x *CreateIPItemResponse) Reset() { + *x = CreateIPItemResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIPItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIPItemResponse) ProtoMessage() {} + +func (x *CreateIPItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIPItemResponse.ProtoReflect.Descriptor instead. +func (*CreateIPItemResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateIPItemResponse) GetIpItemId() int64 { + if x != nil { + return x.IpItemId + } + return 0 +} + +// 修改IP +type UpdateIPItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"` + IpFrom string `protobuf:"bytes,2,opt,name=ipFrom,proto3" json:"ipFrom,omitempty"` + IpTo string `protobuf:"bytes,3,opt,name=ipTo,proto3" json:"ipTo,omitempty"` + ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` + Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *UpdateIPItemRequest) Reset() { + *x = UpdateIPItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIPItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIPItemRequest) ProtoMessage() {} + +func (x *UpdateIPItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateIPItemRequest.ProtoReflect.Descriptor instead. +func (*UpdateIPItemRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateIPItemRequest) GetIpItemId() int64 { + if x != nil { + return x.IpItemId + } + return 0 +} + +func (x *UpdateIPItemRequest) GetIpFrom() string { + if x != nil { + return x.IpFrom + } + return "" +} + +func (x *UpdateIPItemRequest) GetIpTo() string { + if x != nil { + return x.IpTo + } + return "" +} + +func (x *UpdateIPItemRequest) GetExpiredAt() int64 { + if x != nil { + return x.ExpiredAt + } + return 0 +} + +func (x *UpdateIPItemRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +// 删除IP +type DeleteIPItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"` +} + +func (x *DeleteIPItemRequest) Reset() { + *x = DeleteIPItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIPItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIPItemRequest) ProtoMessage() {} + +func (x *DeleteIPItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteIPItemRequest.ProtoReflect.Descriptor instead. +func (*DeleteIPItemRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteIPItemRequest) GetIpItemId() int64 { + if x != nil { + return x.IpItemId + } + return 0 +} + +// 计算IP数量 +type CountIPItemsWithListIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` +} + +func (x *CountIPItemsWithListIdRequest) Reset() { + *x = CountIPItemsWithListIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountIPItemsWithListIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountIPItemsWithListIdRequest) ProtoMessage() {} + +func (x *CountIPItemsWithListIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountIPItemsWithListIdRequest.ProtoReflect.Descriptor instead. +func (*CountIPItemsWithListIdRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{4} +} + +func (x *CountIPItemsWithListIdRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +type CountIPItemsWithListIdResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountIPItemsWithListIdResponse) Reset() { + *x = CountIPItemsWithListIdResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountIPItemsWithListIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountIPItemsWithListIdResponse) ProtoMessage() {} + +func (x *CountIPItemsWithListIdResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_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 CountIPItemsWithListIdResponse.ProtoReflect.Descriptor instead. +func (*CountIPItemsWithListIdResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{5} +} + +func (x *CountIPItemsWithListIdResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 列出单页的IP +type ListIPItemsWithListIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,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"` +} + +func (x *ListIPItemsWithListIdRequest) Reset() { + *x = ListIPItemsWithListIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIPItemsWithListIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIPItemsWithListIdRequest) ProtoMessage() {} + +func (x *ListIPItemsWithListIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_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 ListIPItemsWithListIdRequest.ProtoReflect.Descriptor instead. +func (*ListIPItemsWithListIdRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{6} +} + +func (x *ListIPItemsWithListIdRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +func (x *ListIPItemsWithListIdRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListIPItemsWithListIdRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListIPItemsWithListIdResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItems []*IPItem `protobuf:"bytes,1,rep,name=ipItems,proto3" json:"ipItems,omitempty"` +} + +func (x *ListIPItemsWithListIdResponse) Reset() { + *x = ListIPItemsWithListIdResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIPItemsWithListIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIPItemsWithListIdResponse) ProtoMessage() {} + +func (x *ListIPItemsWithListIdResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_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 ListIPItemsWithListIdResponse.ProtoReflect.Descriptor instead. +func (*ListIPItemsWithListIdResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{7} +} + +func (x *ListIPItemsWithListIdResponse) GetIpItems() []*IPItem { + if x != nil { + return x.IpItems + } + return nil +} + +// 查找单个IP +type FindEnabledIPItemRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItemId int64 `protobuf:"varint,1,opt,name=ipItemId,proto3" json:"ipItemId,omitempty"` +} + +func (x *FindEnabledIPItemRequest) Reset() { + *x = FindEnabledIPItemRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPItemRequest) ProtoMessage() {} + +func (x *FindEnabledIPItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_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 FindEnabledIPItemRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledIPItemRequest) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{8} +} + +func (x *FindEnabledIPItemRequest) GetIpItemId() int64 { + if x != nil { + return x.IpItemId + } + return 0 +} + +type FindEnabledIPItemResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpItem *IPItem `protobuf:"bytes,1,opt,name=ipItem,proto3" json:"ipItem,omitempty"` +} + +func (x *FindEnabledIPItemResponse) Reset() { + *x = FindEnabledIPItemResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_item_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPItemResponse) ProtoMessage() {} + +func (x *FindEnabledIPItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_item_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 FindEnabledIPItemResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledIPItemResponse) Descriptor() ([]byte, []int) { + return file_service_ip_item_proto_rawDescGZIP(), []int{9} +} + +func (x *FindEnabledIPItemResponse) GetIpItem() *IPItem { + if x != nil { + return x.IpItem + } + return nil +} + +var File_service_ip_item_proto protoreflect.FileDescriptor + +var file_service_ip_item_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x12, 0x72, 0x70, 0x63, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x69, 0x70, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x50, 0x49, 0x74, 0x65, 0x6d, 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, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, + 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, + 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, 0x54, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x69, 0x70, 0x54, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x14, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 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, 0x93, + 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 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, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x70, + 0x54, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x70, 0x54, 0x6f, 0x12, 0x1c, + 0x0a, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 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, 0x3b, 0x0a, 0x1d, 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, 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, 0x36, 0x0a, 0x1e, 0x43, 0x6f, 0x75, 0x6e, 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, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x66, 0x0a, 0x1c, + 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, 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, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x02, 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, 0x45, 0x0a, 0x1d, 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, 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, 0x22, 0x36, 0x0a, 0x18, 0x46, + 0x69, 0x6e, 0x64, 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, 0x3f, 0x0a, 0x19, 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, 0x22, 0x0a, 0x06, 0x69, 0x70, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x50, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x69, 0x70, + 0x49, 0x74, 0x65, 0x6d, 0x32, 0xe1, 0x03, 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, 0x3d, 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, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 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, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5f, 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, 0x22, 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, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_service_ip_item_proto_rawDescOnce sync.Once + file_service_ip_item_proto_rawDescData = file_service_ip_item_proto_rawDesc +) + +func file_service_ip_item_proto_rawDescGZIP() []byte { + file_service_ip_item_proto_rawDescOnce.Do(func() { + file_service_ip_item_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_ip_item_proto_rawDescData) + }) + return file_service_ip_item_proto_rawDescData +} + +var file_service_ip_item_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_service_ip_item_proto_goTypes = []interface{}{ + (*CreateIPItemRequest)(nil), // 0: pb.CreateIPItemRequest + (*CreateIPItemResponse)(nil), // 1: pb.CreateIPItemResponse + (*UpdateIPItemRequest)(nil), // 2: pb.UpdateIPItemRequest + (*DeleteIPItemRequest)(nil), // 3: pb.DeleteIPItemRequest + (*CountIPItemsWithListIdRequest)(nil), // 4: pb.CountIPItemsWithListIdRequest + (*CountIPItemsWithListIdResponse)(nil), // 5: pb.CountIPItemsWithListIdResponse + (*ListIPItemsWithListIdRequest)(nil), // 6: pb.ListIPItemsWithListIdRequest + (*ListIPItemsWithListIdResponse)(nil), // 7: pb.ListIPItemsWithListIdResponse + (*FindEnabledIPItemRequest)(nil), // 8: pb.FindEnabledIPItemRequest + (*FindEnabledIPItemResponse)(nil), // 9: pb.FindEnabledIPItemResponse + (*IPItem)(nil), // 10: pb.IPItem + (*RPCUpdateSuccess)(nil), // 11: pb.RPCUpdateSuccess + (*RPCDeleteSuccess)(nil), // 12: pb.RPCDeleteSuccess +} +var file_service_ip_item_proto_depIdxs = []int32{ + 10, // 0: pb.ListIPItemsWithListIdResponse.ipItems:type_name -> pb.IPItem + 10, // 1: pb.FindEnabledIPItemResponse.ipItem:type_name -> pb.IPItem + 0, // 2: pb.IPItemService.createIPItem:input_type -> pb.CreateIPItemRequest + 2, // 3: pb.IPItemService.updateIPItem:input_type -> pb.UpdateIPItemRequest + 3, // 4: pb.IPItemService.deleteIPItem:input_type -> pb.DeleteIPItemRequest + 4, // 5: pb.IPItemService.countIPItemsWithListId:input_type -> pb.CountIPItemsWithListIdRequest + 6, // 6: pb.IPItemService.listIPItemsWithListId:input_type -> pb.ListIPItemsWithListIdRequest + 8, // 7: pb.IPItemService.findEnabledIPItem:input_type -> pb.FindEnabledIPItemRequest + 1, // 8: pb.IPItemService.createIPItem:output_type -> pb.CreateIPItemResponse + 11, // 9: pb.IPItemService.updateIPItem:output_type -> pb.RPCUpdateSuccess + 12, // 10: pb.IPItemService.deleteIPItem:output_type -> pb.RPCDeleteSuccess + 5, // 11: pb.IPItemService.countIPItemsWithListId:output_type -> pb.CountIPItemsWithListIdResponse + 7, // 12: pb.IPItemService.listIPItemsWithListId:output_type -> pb.ListIPItemsWithListIdResponse + 9, // 13: pb.IPItemService.findEnabledIPItem:output_type -> pb.FindEnabledIPItemResponse + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] 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_item_proto_init() } +func file_service_ip_item_proto_init() { + if File_service_ip_item_proto != nil { + return + } + file_rpc_messages_proto_init() + file_model_ip_item_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_ip_item_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIPItemRequest); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIPItemResponse); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIPItemRequest); 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[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIPItemRequest); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountIPItemsWithListIdRequest); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountIPItemsWithListIdResponse); 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[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIPItemsWithListIdRequest); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIPItemsWithListIdResponse); 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[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPItemRequest); 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[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPItemResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_ip_item_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_ip_item_proto_goTypes, + DependencyIndexes: file_service_ip_item_proto_depIdxs, + MessageInfos: file_service_ip_item_proto_msgTypes, + }.Build() + File_service_ip_item_proto = out.File + file_service_ip_item_proto_rawDesc = nil + file_service_ip_item_proto_goTypes = nil + file_service_ip_item_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// IPItemServiceClient is the client API for IPItemService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IPItemServiceClient interface { + // 创建IP + CreateIPItem(ctx context.Context, in *CreateIPItemRequest, opts ...grpc.CallOption) (*CreateIPItemResponse, error) + // 修改IP + UpdateIPItem(ctx context.Context, in *UpdateIPItemRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) + // 删除IP + DeleteIPItem(ctx context.Context, in *DeleteIPItemRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error) + // 计算IP数量 + CountIPItemsWithListId(ctx context.Context, in *CountIPItemsWithListIdRequest, opts ...grpc.CallOption) (*CountIPItemsWithListIdResponse, error) + // 列出单页的IP + ListIPItemsWithListId(ctx context.Context, in *ListIPItemsWithListIdRequest, opts ...grpc.CallOption) (*ListIPItemsWithListIdResponse, error) + // 查找单个IP + FindEnabledIPItem(ctx context.Context, in *FindEnabledIPItemRequest, opts ...grpc.CallOption) (*FindEnabledIPItemResponse, error) +} + +type iPItemServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewIPItemServiceClient(cc grpc.ClientConnInterface) IPItemServiceClient { + return &iPItemServiceClient{cc} +} + +func (c *iPItemServiceClient) CreateIPItem(ctx context.Context, in *CreateIPItemRequest, opts ...grpc.CallOption) (*CreateIPItemResponse, error) { + out := new(CreateIPItemResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/createIPItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) UpdateIPItem(ctx context.Context, in *UpdateIPItemRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) { + out := new(RPCUpdateSuccess) + err := c.cc.Invoke(ctx, "/pb.IPItemService/updateIPItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) DeleteIPItem(ctx context.Context, in *DeleteIPItemRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error) { + out := new(RPCDeleteSuccess) + err := c.cc.Invoke(ctx, "/pb.IPItemService/deleteIPItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) CountIPItemsWithListId(ctx context.Context, in *CountIPItemsWithListIdRequest, opts ...grpc.CallOption) (*CountIPItemsWithListIdResponse, error) { + out := new(CountIPItemsWithListIdResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/countIPItemsWithListId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) ListIPItemsWithListId(ctx context.Context, in *ListIPItemsWithListIdRequest, opts ...grpc.CallOption) (*ListIPItemsWithListIdResponse, error) { + out := new(ListIPItemsWithListIdResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/listIPItemsWithListId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPItemServiceClient) FindEnabledIPItem(ctx context.Context, in *FindEnabledIPItemRequest, opts ...grpc.CallOption) (*FindEnabledIPItemResponse, error) { + out := new(FindEnabledIPItemResponse) + err := c.cc.Invoke(ctx, "/pb.IPItemService/findEnabledIPItem", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// IPItemServiceServer is the server API for IPItemService service. +type IPItemServiceServer interface { + // 创建IP + CreateIPItem(context.Context, *CreateIPItemRequest) (*CreateIPItemResponse, error) + // 修改IP + UpdateIPItem(context.Context, *UpdateIPItemRequest) (*RPCUpdateSuccess, error) + // 删除IP + DeleteIPItem(context.Context, *DeleteIPItemRequest) (*RPCDeleteSuccess, error) + // 计算IP数量 + CountIPItemsWithListId(context.Context, *CountIPItemsWithListIdRequest) (*CountIPItemsWithListIdResponse, error) + // 列出单页的IP + ListIPItemsWithListId(context.Context, *ListIPItemsWithListIdRequest) (*ListIPItemsWithListIdResponse, error) + // 查找单个IP + FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error) +} + +// UnimplementedIPItemServiceServer can be embedded to have forward compatible implementations. +type UnimplementedIPItemServiceServer struct { +} + +func (*UnimplementedIPItemServiceServer) CreateIPItem(context.Context, *CreateIPItemRequest) (*CreateIPItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIPItem not implemented") +} +func (*UnimplementedIPItemServiceServer) UpdateIPItem(context.Context, *UpdateIPItemRequest) (*RPCUpdateSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateIPItem not implemented") +} +func (*UnimplementedIPItemServiceServer) DeleteIPItem(context.Context, *DeleteIPItemRequest) (*RPCDeleteSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIPItem not implemented") +} +func (*UnimplementedIPItemServiceServer) CountIPItemsWithListId(context.Context, *CountIPItemsWithListIdRequest) (*CountIPItemsWithListIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountIPItemsWithListId not implemented") +} +func (*UnimplementedIPItemServiceServer) ListIPItemsWithListId(context.Context, *ListIPItemsWithListIdRequest) (*ListIPItemsWithListIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListIPItemsWithListId not implemented") +} +func (*UnimplementedIPItemServiceServer) FindEnabledIPItem(context.Context, *FindEnabledIPItemRequest) (*FindEnabledIPItemResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPItem not implemented") +} + +func RegisterIPItemServiceServer(s *grpc.Server, srv IPItemServiceServer) { + s.RegisterService(&_IPItemService_serviceDesc, srv) +} + +func _IPItemService_CreateIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIPItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).CreateIPItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/CreateIPItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).CreateIPItem(ctx, req.(*CreateIPItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_UpdateIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateIPItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).UpdateIPItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/UpdateIPItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).UpdateIPItem(ctx, req.(*UpdateIPItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_DeleteIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIPItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).DeleteIPItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/DeleteIPItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).DeleteIPItem(ctx, req.(*DeleteIPItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_CountIPItemsWithListId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountIPItemsWithListIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).CountIPItemsWithListId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/CountIPItemsWithListId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).CountIPItemsWithListId(ctx, req.(*CountIPItemsWithListIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_ListIPItemsWithListId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIPItemsWithListIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).ListIPItemsWithListId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/ListIPItemsWithListId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).ListIPItemsWithListId(ctx, req.(*ListIPItemsWithListIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPItemService_FindEnabledIPItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledIPItemRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPItemServiceServer).FindEnabledIPItem(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPItemService/FindEnabledIPItem", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPItemServiceServer).FindEnabledIPItem(ctx, req.(*FindEnabledIPItemRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _IPItemService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.IPItemService", + HandlerType: (*IPItemServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createIPItem", + Handler: _IPItemService_CreateIPItem_Handler, + }, + { + MethodName: "updateIPItem", + Handler: _IPItemService_UpdateIPItem_Handler, + }, + { + MethodName: "deleteIPItem", + Handler: _IPItemService_DeleteIPItem_Handler, + }, + { + MethodName: "countIPItemsWithListId", + Handler: _IPItemService_CountIPItemsWithListId_Handler, + }, + { + MethodName: "listIPItemsWithListId", + Handler: _IPItemService_ListIPItemsWithListId_Handler, + }, + { + MethodName: "findEnabledIPItem", + Handler: _IPItemService_FindEnabledIPItem_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_ip_item.proto", +} diff --git a/pkg/rpc/pb/service_ip_list.pb.go b/pkg/rpc/pb/service_ip_list.pb.go new file mode 100644 index 0000000..4255315 --- /dev/null +++ b/pkg/rpc/pb/service_ip_list.pb.go @@ -0,0 +1,651 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_ip_list.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// 创建IP列表 +type CreateIPListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + 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"` +} + +func (x *CreateIPListRequest) Reset() { + *x = CreateIPListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIPListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIPListRequest) ProtoMessage() {} + +func (x *CreateIPListRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIPListRequest.ProtoReflect.Descriptor instead. +func (*CreateIPListRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateIPListRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *CreateIPListRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateIPListRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *CreateIPListRequest) GetTimeoutJSON() []byte { + if x != nil { + return x.TimeoutJSON + } + return nil +} + +type CreateIPListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` +} + +func (x *CreateIPListResponse) Reset() { + *x = CreateIPListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIPListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIPListResponse) ProtoMessage() {} + +func (x *CreateIPListResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIPListResponse.ProtoReflect.Descriptor instead. +func (*CreateIPListResponse) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateIPListResponse) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +// 修改IP列表 +type UpdateIPListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` + 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"` +} + +func (x *UpdateIPListRequest) Reset() { + *x = UpdateIPListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIPListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIPListRequest) ProtoMessage() {} + +func (x *UpdateIPListRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateIPListRequest.ProtoReflect.Descriptor instead. +func (*UpdateIPListRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateIPListRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +func (x *UpdateIPListRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateIPListRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *UpdateIPListRequest) GetTimeoutJSON() []byte { + if x != nil { + return x.TimeoutJSON + } + return nil +} + +// 查找IP列表 +type FindEnabledIPListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpListId int64 `protobuf:"varint,1,opt,name=ipListId,proto3" json:"ipListId,omitempty"` +} + +func (x *FindEnabledIPListRequest) Reset() { + *x = FindEnabledIPListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPListRequest) ProtoMessage() {} + +func (x *FindEnabledIPListRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindEnabledIPListRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledIPListRequest) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{3} +} + +func (x *FindEnabledIPListRequest) GetIpListId() int64 { + if x != nil { + return x.IpListId + } + return 0 +} + +type FindEnabledIPListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IpList *IPList `protobuf:"bytes,1,opt,name=ipList,proto3" json:"ipList,omitempty"` +} + +func (x *FindEnabledIPListResponse) Reset() { + *x = FindEnabledIPListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_ip_list_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledIPListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledIPListResponse) ProtoMessage() {} + +func (x *FindEnabledIPListResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_ip_list_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindEnabledIPListResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledIPListResponse) Descriptor() ([]byte, []int) { + return file_service_ip_list_proto_rawDescGZIP(), []int{4} +} + +func (x *FindEnabledIPListResponse) GetIpList() *IPList { + if x != nil { + return x.IpList + } + return nil +} + +var File_service_ip_list_proto protoreflect.FileDescriptor + +var file_service_ip_list_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x70, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x12, 0x72, 0x70, 0x63, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 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, 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, 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, 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, 0xe3, 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, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 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, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_service_ip_list_proto_rawDescOnce sync.Once + file_service_ip_list_proto_rawDescData = file_service_ip_list_proto_rawDesc +) + +func file_service_ip_list_proto_rawDescGZIP() []byte { + file_service_ip_list_proto_rawDescOnce.Do(func() { + file_service_ip_list_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_ip_list_proto_rawDescData) + }) + return file_service_ip_list_proto_rawDescData +} + +var file_service_ip_list_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +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 + (*RPCUpdateSuccess)(nil), // 6: pb.RPCUpdateSuccess +} +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.RPCUpdateSuccess + 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 +} + +func init() { file_service_ip_list_proto_init() } +func file_service_ip_list_proto_init() { + if File_service_ip_list_proto != nil { + return + } + file_rpc_messages_proto_init() + file_model_ip_list_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_ip_list_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIPListRequest); 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[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIPListResponse); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIPListRequest); 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[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPListRequest); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledIPListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_ip_list_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_ip_list_proto_goTypes, + DependencyIndexes: file_service_ip_list_proto_depIdxs, + MessageInfos: file_service_ip_list_proto_msgTypes, + }.Build() + File_service_ip_list_proto = out.File + file_service_ip_list_proto_rawDesc = nil + file_service_ip_list_proto_goTypes = nil + file_service_ip_list_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// IPListServiceClient is the client API for IPListService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IPListServiceClient interface { + // 创建IP列表 + CreateIPList(ctx context.Context, in *CreateIPListRequest, opts ...grpc.CallOption) (*CreateIPListResponse, error) + // 修改IP列表 + UpdateIPList(ctx context.Context, in *UpdateIPListRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) + // 查找IP列表 + FindEnabledIPList(ctx context.Context, in *FindEnabledIPListRequest, opts ...grpc.CallOption) (*FindEnabledIPListResponse, error) +} + +type iPListServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewIPListServiceClient(cc grpc.ClientConnInterface) IPListServiceClient { + return &iPListServiceClient{cc} +} + +func (c *iPListServiceClient) CreateIPList(ctx context.Context, in *CreateIPListRequest, opts ...grpc.CallOption) (*CreateIPListResponse, error) { + out := new(CreateIPListResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/createIPList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPListServiceClient) UpdateIPList(ctx context.Context, in *UpdateIPListRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) { + out := new(RPCUpdateSuccess) + err := c.cc.Invoke(ctx, "/pb.IPListService/updateIPList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *iPListServiceClient) FindEnabledIPList(ctx context.Context, in *FindEnabledIPListRequest, opts ...grpc.CallOption) (*FindEnabledIPListResponse, error) { + out := new(FindEnabledIPListResponse) + err := c.cc.Invoke(ctx, "/pb.IPListService/findEnabledIPList", 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) (*RPCUpdateSuccess, error) + // 查找IP列表 + FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error) +} + +// UnimplementedIPListServiceServer can be embedded to have forward compatible implementations. +type UnimplementedIPListServiceServer struct { +} + +func (*UnimplementedIPListServiceServer) CreateIPList(context.Context, *CreateIPListRequest) (*CreateIPListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIPList not implemented") +} +func (*UnimplementedIPListServiceServer) UpdateIPList(context.Context, *UpdateIPListRequest) (*RPCUpdateSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateIPList not implemented") +} +func (*UnimplementedIPListServiceServer) FindEnabledIPList(context.Context, *FindEnabledIPListRequest) (*FindEnabledIPListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledIPList not implemented") +} + +func RegisterIPListServiceServer(s *grpc.Server, srv IPListServiceServer) { + s.RegisterService(&_IPListService_serviceDesc, srv) +} + +func _IPListService_CreateIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIPListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).CreateIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/CreateIPList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).CreateIPList(ctx, req.(*CreateIPListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPListService_UpdateIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateIPListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).UpdateIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/UpdateIPList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).UpdateIPList(ctx, req.(*UpdateIPListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IPListService_FindEnabledIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledIPListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IPListServiceServer).FindEnabledIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.IPListService/FindEnabledIPList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IPListServiceServer).FindEnabledIPList(ctx, req.(*FindEnabledIPListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _IPListService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.IPListService", + HandlerType: (*IPListServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createIPList", + Handler: _IPListService_CreateIPList_Handler, + }, + { + MethodName: "updateIPList", + Handler: _IPListService_UpdateIPList_Handler, + }, + { + MethodName: "findEnabledIPList", + Handler: _IPListService_FindEnabledIPList_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_ip_list.proto", +} diff --git a/pkg/rpc/protos/model_ip_item.proto b/pkg/rpc/protos/model_ip_item.proto new file mode 100644 index 0000000..f4072db --- /dev/null +++ b/pkg/rpc/protos/model_ip_item.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message IPItem { + int64 id = 1; + string ipFrom = 2; + string ipTo = 3; + int64 version = 4; + int64 expiredAt = 5; + string reason = 6; +} \ No newline at end of file diff --git a/pkg/rpc/protos/model_ip_list.proto b/pkg/rpc/protos/model_ip_list.proto new file mode 100644 index 0000000..4af1011 --- /dev/null +++ b/pkg/rpc/protos/model_ip_list.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message IPList { + int64 id = 1; + bool isOn = 2; + string type = 3; + string name = 4; + string code = 5; + bytes timeoutJSON = 6; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_ip_item.proto b/pkg/rpc/protos/service_ip_item.proto new file mode 100644 index 0000000..b599310 --- /dev/null +++ b/pkg/rpc/protos/service_ip_item.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "rpc_messages.proto"; +import "model_ip_item.proto"; + +// IP条目管理 +service IPItemService { + // 创建IP + rpc createIPItem (CreateIPItemRequest) returns (CreateIPItemResponse); + + // 修改IP + rpc updateIPItem (UpdateIPItemRequest) returns (RPCUpdateSuccess); + + // 删除IP + rpc deleteIPItem (DeleteIPItemRequest) returns (RPCDeleteSuccess); + + // 计算IP数量 + rpc countIPItemsWithListId (CountIPItemsWithListIdRequest) returns (CountIPItemsWithListIdResponse); + + // 列出单页的IP + rpc listIPItemsWithListId (ListIPItemsWithListIdRequest) returns (ListIPItemsWithListIdResponse); + + // 查找单个IP + rpc findEnabledIPItem (FindEnabledIPItemRequest) returns (FindEnabledIPItemResponse); +} + +// 创建IP +message CreateIPItemRequest { + int64 ipListId = 1; + string ipFrom = 2; + string ipTo = 3; + int64 expiredAt = 4; + string reason = 5; +} + +message CreateIPItemResponse { + int64 ipItemId = 1; +} + +// 修改IP +message UpdateIPItemRequest { + int64 ipItemId = 1; + string ipFrom = 2; + string ipTo = 3; + int64 expiredAt = 4; + string reason = 5; +} + +// 删除IP +message DeleteIPItemRequest { + int64 ipItemId = 1; +} + +// 计算IP数量 +message CountIPItemsWithListIdRequest { + int64 ipListId = 1; +} + +message CountIPItemsWithListIdResponse { + int64 count = 1; +} + +// 列出单页的IP +message ListIPItemsWithListIdRequest { + int64 ipListId = 1; + int64 offset = 2; + int64 size = 3; +} + +message ListIPItemsWithListIdResponse { + repeated IPItem ipItems = 1; +} + +// 查找单个IP +message FindEnabledIPItemRequest { + int64 ipItemId = 1; +} + +message FindEnabledIPItemResponse { + IPItem ipItem = 1; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_ip_list.proto b/pkg/rpc/protos/service_ip_list.proto new file mode 100644 index 0000000..a05437f --- /dev/null +++ b/pkg/rpc/protos/service_ip_list.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "rpc_messages.proto"; +import "model_ip_list.proto"; + +// IP列表 +service IPListService { + // 创建IP列表 + rpc createIPList (CreateIPListRequest) returns (CreateIPListResponse); + + // 修改IP列表 + rpc updateIPList (UpdateIPListRequest) returns (RPCUpdateSuccess); + + // 查找IP列表 + rpc findEnabledIPList (FindEnabledIPListRequest) returns (FindEnabledIPListResponse); +} + +// 创建IP列表 +message CreateIPListRequest { + string type = 1; + string name = 2; + string code = 3; + bytes timeoutJSON = 4; +} + +message CreateIPListResponse { + int64 ipListId = 1; +} + +// 修改IP列表 +message UpdateIPListRequest { + int64 ipListId = 1; + string name = 2; + string code = 3; + bytes timeoutJSON = 4; +} + +// 查找IP列表 +message FindEnabledIPListRequest { + int64 ipListId = 1; +} + +message FindEnabledIPListResponse { + IPList ipList = 1; +} \ No newline at end of file diff --git a/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go b/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go index d6fff98..796807f 100644 --- a/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go +++ b/pkg/serverconfigs/firewallconfigs/http_firewall_inbound_config.go @@ -1,5 +1,7 @@ package firewallconfigs +import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ipconfigs" + type HTTPFirewallInboundConfig struct { IsOn bool `yaml:"isOn" json:"isOn"` GroupRefs []*HTTPFirewallRuleGroupRef `yaml:"groupRefs" json:"groupRefs"` @@ -7,6 +9,11 @@ type HTTPFirewallInboundConfig struct { // 地区相关 Region *HTTPFirewallRegionConfig `yaml:"region" json:"region"` + + // IP名单 + WhiteListRef *ipconfigs.IPListRef `yaml:"whiteListRef" json:"whiteListRef"` + BlackListRef *ipconfigs.IPListRef `yaml:"blackListRef" json:"blackListRef"` + GreyListRef *ipconfigs.IPListRef `yaml:"greyListRef" json:"greyListRef"` } // 初始化 diff --git a/pkg/serverconfigs/ipconfigs/ip_list_config.go b/pkg/serverconfigs/ipconfigs/ip_list_config.go new file mode 100644 index 0000000..4084d80 --- /dev/null +++ b/pkg/serverconfigs/ipconfigs/ip_list_config.go @@ -0,0 +1,13 @@ +package ipconfigs + +import "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared" + +// IP名单配置 +type IPListConfig struct { + Id int64 `yaml:"id" json:"id"` // ID + IsOn bool `yaml:"isOn" json:"isOn"` // 是否启用 + Version int64 `yaml:"version" json:"version"` // 版本号 + Timeout *shared.TimeDuration `yaml:"timeout" json:"timeout"` // 默认超时时间 + Code string `yaml:"code" json:"code"` // 代号 + Type string `yaml:"type" json:"type"` // 类型 +} diff --git a/pkg/serverconfigs/ipconfigs/ip_list_ref.go b/pkg/serverconfigs/ipconfigs/ip_list_ref.go new file mode 100644 index 0000000..6e6598c --- /dev/null +++ b/pkg/serverconfigs/ipconfigs/ip_list_ref.go @@ -0,0 +1,7 @@ +package ipconfigs + +// IP名单引用 +type IPListRef struct { + IsOn bool `yaml:"isOn" json:"isOn"` + ListId int64 `yaml:"listId" json:"listId"` +} diff --git a/pkg/serverconfigs/ipconfigs/ip_list_types.go b/pkg/serverconfigs/ipconfigs/ip_list_types.go new file mode 100644 index 0000000..596cc00 --- /dev/null +++ b/pkg/serverconfigs/ipconfigs/ip_list_types.go @@ -0,0 +1,26 @@ +package ipconfigs + +import "github.com/iwind/TeaGo/maps" + +type IPListType = string + +const ( + IPListTypeWhite IPListType = "white" + IPListTypeBlack IPListType = "black" + IPListTypeGrey IPListType = "grey" +) + +var IPListTypes = []maps.Map{ + { + "name": "白名单", + "code": IPListTypeWhite, + }, + { + "name": "黑名单", + "code": IPListTypeBlack, + }, + { + "name": "灰名单", + "code": IPListTypeGrey, + }, +}