diff --git a/pkg/rpc/pb/model_traffic_daily_stat.pb.go b/pkg/rpc/pb/model_traffic_daily_stat.pb.go new file mode 100644 index 0000000..2eeb53c --- /dev/null +++ b/pkg/rpc/pb/model_traffic_daily_stat.pb.go @@ -0,0 +1,219 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.19.4 +// source: models/model_traffic_daily_stat.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 TrafficDailyStat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Day string `protobuf:"bytes,2,opt,name=day,proto3" json:"day,omitempty"` + CachedBytes int64 `protobuf:"varint,3,opt,name=cachedBytes,proto3" json:"cachedBytes,omitempty"` + Bytes int64 `protobuf:"varint,4,opt,name=bytes,proto3" json:"bytes,omitempty"` + CountRequests int64 `protobuf:"varint,5,opt,name=countRequests,proto3" json:"countRequests,omitempty"` + CountCachedRequests int64 `protobuf:"varint,6,opt,name=countCachedRequests,proto3" json:"countCachedRequests,omitempty"` + CountAttackRequests int64 `protobuf:"varint,7,opt,name=countAttackRequests,proto3" json:"countAttackRequests,omitempty"` + AttackBytes int64 `protobuf:"varint,8,opt,name=attackBytes,proto3" json:"attackBytes,omitempty"` +} + +func (x *TrafficDailyStat) Reset() { + *x = TrafficDailyStat{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_traffic_daily_stat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrafficDailyStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrafficDailyStat) ProtoMessage() {} + +func (x *TrafficDailyStat) ProtoReflect() protoreflect.Message { + mi := &file_models_model_traffic_daily_stat_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 TrafficDailyStat.ProtoReflect.Descriptor instead. +func (*TrafficDailyStat) Descriptor() ([]byte, []int) { + return file_models_model_traffic_daily_stat_proto_rawDescGZIP(), []int{0} +} + +func (x *TrafficDailyStat) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TrafficDailyStat) GetDay() string { + if x != nil { + return x.Day + } + return "" +} + +func (x *TrafficDailyStat) GetCachedBytes() int64 { + if x != nil { + return x.CachedBytes + } + return 0 +} + +func (x *TrafficDailyStat) GetBytes() int64 { + if x != nil { + return x.Bytes + } + return 0 +} + +func (x *TrafficDailyStat) GetCountRequests() int64 { + if x != nil { + return x.CountRequests + } + return 0 +} + +func (x *TrafficDailyStat) GetCountCachedRequests() int64 { + if x != nil { + return x.CountCachedRequests + } + return 0 +} + +func (x *TrafficDailyStat) GetCountAttackRequests() int64 { + if x != nil { + return x.CountAttackRequests + } + return 0 +} + +func (x *TrafficDailyStat) GetAttackBytes() int64 { + if x != nil { + return x.AttackBytes + } + return 0 +} + +var File_models_model_traffic_daily_stat_proto protoreflect.FileDescriptor + +var file_models_model_traffic_daily_stat_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x98, 0x02, 0x0a, 0x10, + 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, + 0x61, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x64, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x12, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, + 0x6b, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_traffic_daily_stat_proto_rawDescOnce sync.Once + file_models_model_traffic_daily_stat_proto_rawDescData = file_models_model_traffic_daily_stat_proto_rawDesc +) + +func file_models_model_traffic_daily_stat_proto_rawDescGZIP() []byte { + file_models_model_traffic_daily_stat_proto_rawDescOnce.Do(func() { + file_models_model_traffic_daily_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_traffic_daily_stat_proto_rawDescData) + }) + return file_models_model_traffic_daily_stat_proto_rawDescData +} + +var file_models_model_traffic_daily_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_traffic_daily_stat_proto_goTypes = []interface{}{ + (*TrafficDailyStat)(nil), // 0: pb.TrafficDailyStat +} +var file_models_model_traffic_daily_stat_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_models_model_traffic_daily_stat_proto_init() } +func file_models_model_traffic_daily_stat_proto_init() { + if File_models_model_traffic_daily_stat_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_model_traffic_daily_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TrafficDailyStat); 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_models_model_traffic_daily_stat_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_traffic_daily_stat_proto_goTypes, + DependencyIndexes: file_models_model_traffic_daily_stat_proto_depIdxs, + MessageInfos: file_models_model_traffic_daily_stat_proto_msgTypes, + }.Build() + File_models_model_traffic_daily_stat_proto = out.File + file_models_model_traffic_daily_stat_proto_rawDesc = nil + file_models_model_traffic_daily_stat_proto_goTypes = nil + file_models_model_traffic_daily_stat_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_traffic_daily_stat.pb.go b/pkg/rpc/pb/service_traffic_daily_stat.pb.go new file mode 100644 index 0000000..b83187d --- /dev/null +++ b/pkg/rpc/pb/service_traffic_daily_stat.pb.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.19.4 +// source: service_traffic_daily_stat.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 + +// 查找某日统计 +type FindTrafficDailyStatWithDayRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"` // YYYYMMDD +} + +func (x *FindTrafficDailyStatWithDayRequest) Reset() { + *x = FindTrafficDailyStatWithDayRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_traffic_daily_stat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindTrafficDailyStatWithDayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindTrafficDailyStatWithDayRequest) ProtoMessage() {} + +func (x *FindTrafficDailyStatWithDayRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_traffic_daily_stat_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 FindTrafficDailyStatWithDayRequest.ProtoReflect.Descriptor instead. +func (*FindTrafficDailyStatWithDayRequest) Descriptor() ([]byte, []int) { + return file_service_traffic_daily_stat_proto_rawDescGZIP(), []int{0} +} + +func (x *FindTrafficDailyStatWithDayRequest) GetDay() string { + if x != nil { + return x.Day + } + return "" +} + +type FindTrafficDailyStatWithDayResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TrafficDailyStat *TrafficDailyStat `protobuf:"bytes,1,opt,name=trafficDailyStat,proto3" json:"trafficDailyStat,omitempty"` +} + +func (x *FindTrafficDailyStatWithDayResponse) Reset() { + *x = FindTrafficDailyStatWithDayResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_traffic_daily_stat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindTrafficDailyStatWithDayResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindTrafficDailyStatWithDayResponse) ProtoMessage() {} + +func (x *FindTrafficDailyStatWithDayResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_traffic_daily_stat_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 FindTrafficDailyStatWithDayResponse.ProtoReflect.Descriptor instead. +func (*FindTrafficDailyStatWithDayResponse) Descriptor() ([]byte, []int) { + return file_service_traffic_daily_stat_proto_rawDescGZIP(), []int{1} +} + +func (x *FindTrafficDailyStatWithDayResponse) GetTrafficDailyStat() *TrafficDailyStat { + if x != nil { + return x.TrafficDailyStat + } + return nil +} + +var File_service_traffic_daily_stat_proto protoreflect.FileDescriptor + +var file_service_traffic_daily_stat_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x63, 0x5f, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x25, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x64, 0x61, 0x69, + 0x6c, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, + 0x22, 0x46, 0x69, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, + 0x79, 0x53, 0x74, 0x61, 0x74, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x61, 0x79, 0x22, 0x67, 0x0a, 0x23, 0x46, 0x69, 0x6e, 0x64, 0x54, 0x72, 0x61, + 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x57, 0x69, 0x74, + 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x10, + 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x52, 0x10, 0x74, 0x72, + 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x32, 0x89, + 0x01, 0x0a, 0x17, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, + 0x74, 0x61, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x66, 0x69, + 0x6e, 0x64, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, + 0x74, 0x61, 0x74, 0x57, 0x69, 0x74, 0x68, 0x44, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x63, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x57, 0x69, 0x74, 0x68, 0x44, + 0x61, 0x79, 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_traffic_daily_stat_proto_rawDescOnce sync.Once + file_service_traffic_daily_stat_proto_rawDescData = file_service_traffic_daily_stat_proto_rawDesc +) + +func file_service_traffic_daily_stat_proto_rawDescGZIP() []byte { + file_service_traffic_daily_stat_proto_rawDescOnce.Do(func() { + file_service_traffic_daily_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_traffic_daily_stat_proto_rawDescData) + }) + return file_service_traffic_daily_stat_proto_rawDescData +} + +var file_service_traffic_daily_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_service_traffic_daily_stat_proto_goTypes = []interface{}{ + (*FindTrafficDailyStatWithDayRequest)(nil), // 0: pb.FindTrafficDailyStatWithDayRequest + (*FindTrafficDailyStatWithDayResponse)(nil), // 1: pb.FindTrafficDailyStatWithDayResponse + (*TrafficDailyStat)(nil), // 2: pb.TrafficDailyStat +} +var file_service_traffic_daily_stat_proto_depIdxs = []int32{ + 2, // 0: pb.FindTrafficDailyStatWithDayResponse.trafficDailyStat:type_name -> pb.TrafficDailyStat + 0, // 1: pb.TrafficDailyStatService.findTrafficDailyStatWithDay:input_type -> pb.FindTrafficDailyStatWithDayRequest + 1, // 2: pb.TrafficDailyStatService.findTrafficDailyStatWithDay:output_type -> pb.FindTrafficDailyStatWithDayResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] 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_traffic_daily_stat_proto_init() } +func file_service_traffic_daily_stat_proto_init() { + if File_service_traffic_daily_stat_proto != nil { + return + } + file_models_model_traffic_daily_stat_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_traffic_daily_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindTrafficDailyStatWithDayRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_traffic_daily_stat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindTrafficDailyStatWithDayResponse); 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_traffic_daily_stat_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_traffic_daily_stat_proto_goTypes, + DependencyIndexes: file_service_traffic_daily_stat_proto_depIdxs, + MessageInfos: file_service_traffic_daily_stat_proto_msgTypes, + }.Build() + File_service_traffic_daily_stat_proto = out.File + file_service_traffic_daily_stat_proto_rawDesc = nil + file_service_traffic_daily_stat_proto_goTypes = nil + file_service_traffic_daily_stat_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 + +// TrafficDailyStatServiceClient is the client API for TrafficDailyStatService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type TrafficDailyStatServiceClient interface { + // 查找某日统计 + FindTrafficDailyStatWithDay(ctx context.Context, in *FindTrafficDailyStatWithDayRequest, opts ...grpc.CallOption) (*FindTrafficDailyStatWithDayResponse, error) +} + +type trafficDailyStatServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTrafficDailyStatServiceClient(cc grpc.ClientConnInterface) TrafficDailyStatServiceClient { + return &trafficDailyStatServiceClient{cc} +} + +func (c *trafficDailyStatServiceClient) FindTrafficDailyStatWithDay(ctx context.Context, in *FindTrafficDailyStatWithDayRequest, opts ...grpc.CallOption) (*FindTrafficDailyStatWithDayResponse, error) { + out := new(FindTrafficDailyStatWithDayResponse) + err := c.cc.Invoke(ctx, "/pb.TrafficDailyStatService/findTrafficDailyStatWithDay", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TrafficDailyStatServiceServer is the server API for TrafficDailyStatService service. +type TrafficDailyStatServiceServer interface { + // 查找某日统计 + FindTrafficDailyStatWithDay(context.Context, *FindTrafficDailyStatWithDayRequest) (*FindTrafficDailyStatWithDayResponse, error) +} + +// UnimplementedTrafficDailyStatServiceServer can be embedded to have forward compatible implementations. +type UnimplementedTrafficDailyStatServiceServer struct { +} + +func (*UnimplementedTrafficDailyStatServiceServer) FindTrafficDailyStatWithDay(context.Context, *FindTrafficDailyStatWithDayRequest) (*FindTrafficDailyStatWithDayResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindTrafficDailyStatWithDay not implemented") +} + +func RegisterTrafficDailyStatServiceServer(s *grpc.Server, srv TrafficDailyStatServiceServer) { + s.RegisterService(&_TrafficDailyStatService_serviceDesc, srv) +} + +func _TrafficDailyStatService_FindTrafficDailyStatWithDay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindTrafficDailyStatWithDayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TrafficDailyStatServiceServer).FindTrafficDailyStatWithDay(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.TrafficDailyStatService/FindTrafficDailyStatWithDay", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TrafficDailyStatServiceServer).FindTrafficDailyStatWithDay(ctx, req.(*FindTrafficDailyStatWithDayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _TrafficDailyStatService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.TrafficDailyStatService", + HandlerType: (*TrafficDailyStatServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "findTrafficDailyStatWithDay", + Handler: _TrafficDailyStatService_FindTrafficDailyStatWithDay_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_traffic_daily_stat.proto", +} diff --git a/pkg/rpc/protos/models/model_traffic_daily_stat.proto b/pkg/rpc/protos/models/model_traffic_daily_stat.proto new file mode 100644 index 0000000..df203dc --- /dev/null +++ b/pkg/rpc/protos/models/model_traffic_daily_stat.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message TrafficDailyStat { + int64 id = 1; + string day = 2; + int64 cachedBytes = 3; + int64 bytes = 4; + int64 countRequests = 5; + int64 countCachedRequests = 6; + int64 countAttackRequests = 7; + int64 attackBytes = 8; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_traffic_daily_stat.proto b/pkg/rpc/protos/service_traffic_daily_stat.proto new file mode 100644 index 0000000..4fa1d8b --- /dev/null +++ b/pkg/rpc/protos/service_traffic_daily_stat.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_traffic_daily_stat.proto"; + +// 按日统计服务 +service TrafficDailyStatService { + // 查找某日统计 + rpc findTrafficDailyStatWithDay(FindTrafficDailyStatWithDayRequest) returns (FindTrafficDailyStatWithDayResponse); +} + +// 查找某日统计 +message FindTrafficDailyStatWithDayRequest { + string day = 1; // YYYYMMDD +} + +message FindTrafficDailyStatWithDayResponse { + TrafficDailyStat trafficDailyStat = 1; +} \ No newline at end of file