diff --git a/Cargo.toml b/Cargo.toml index 5e1e6ebc..11c16e26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dragonfly-api" -version = "2.0.32" +version = "2.0.33" authors = ["Gaius "] edition = "2021" license = "Apache-2.0" diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.pb.go b/pkg/apis/dfdaemon/v2/dfdaemon.pb.go index ba3f9ab2..4f4ab350 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.pb.go +++ b/pkg/apis/dfdaemon/v2/dfdaemon.pb.go @@ -217,6 +217,55 @@ func (*SyncPiecesRequest_InterestedAllPiecesRequest) isSyncPiecesRequest_Request func (*SyncPiecesRequest_InterestedPiecesRequest) isSyncPiecesRequest_Request() {} +// InterestedPiecesResponse represents all pieces response of SyncPiecesResponse. +type InterestedAllPiecesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // All of the pieces in task. + Pieces []*v2.Piece `protobuf:"bytes,1,rep,name=pieces,proto3" json:"pieces,omitempty"` +} + +func (x *InterestedAllPiecesResponse) Reset() { + *x = InterestedAllPiecesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InterestedAllPiecesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InterestedAllPiecesResponse) ProtoMessage() {} + +func (x *InterestedAllPiecesResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_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 InterestedAllPiecesResponse.ProtoReflect.Descriptor instead. +func (*InterestedAllPiecesResponse) Descriptor() ([]byte, []int) { + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{3} +} + +func (x *InterestedAllPiecesResponse) GetPieces() []*v2.Piece { + if x != nil { + return x.Pieces + } + return nil +} + // InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. type InterestedPiecesResponse struct { state protoimpl.MessageState @@ -230,7 +279,7 @@ type InterestedPiecesResponse struct { func (x *InterestedPiecesResponse) Reset() { *x = InterestedPiecesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -243,7 +292,7 @@ func (x *InterestedPiecesResponse) String() string { func (*InterestedPiecesResponse) ProtoMessage() {} func (x *InterestedPiecesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -256,7 +305,7 @@ func (x *InterestedPiecesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InterestedPiecesResponse.ProtoReflect.Descriptor instead. func (*InterestedPiecesResponse) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{3} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4} } func (x *InterestedPiecesResponse) GetPieces() []*v2.Piece { @@ -274,6 +323,7 @@ type SyncPiecesResponse struct { // Types that are assignable to Response: // + // *SyncPiecesResponse_InterestedAllPiecesResponse // *SyncPiecesResponse_InterestedPiecesResponse Response isSyncPiecesResponse_Response `protobuf_oneof:"response"` } @@ -281,7 +331,7 @@ type SyncPiecesResponse struct { func (x *SyncPiecesResponse) Reset() { *x = SyncPiecesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -294,7 +344,7 @@ func (x *SyncPiecesResponse) String() string { func (*SyncPiecesResponse) ProtoMessage() {} func (x *SyncPiecesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -307,7 +357,7 @@ func (x *SyncPiecesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncPiecesResponse.ProtoReflect.Descriptor instead. func (*SyncPiecesResponse) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5} } func (m *SyncPiecesResponse) GetResponse() isSyncPiecesResponse_Response { @@ -317,6 +367,13 @@ func (m *SyncPiecesResponse) GetResponse() isSyncPiecesResponse_Response { return nil } +func (x *SyncPiecesResponse) GetInterestedAllPiecesResponse() *InterestedAllPiecesResponse { + if x, ok := x.GetResponse().(*SyncPiecesResponse_InterestedAllPiecesResponse); ok { + return x.InterestedAllPiecesResponse + } + return nil +} + func (x *SyncPiecesResponse) GetInterestedPiecesResponse() *InterestedPiecesResponse { if x, ok := x.GetResponse().(*SyncPiecesResponse_InterestedPiecesResponse); ok { return x.InterestedPiecesResponse @@ -328,10 +385,16 @@ type isSyncPiecesResponse_Response interface { isSyncPiecesResponse_Response() } +type SyncPiecesResponse_InterestedAllPiecesResponse struct { + InterestedAllPiecesResponse *InterestedAllPiecesResponse `protobuf:"bytes,1,opt,name=interested_all_pieces_response,json=interestedAllPiecesResponse,proto3,oneof"` +} + type SyncPiecesResponse_InterestedPiecesResponse struct { - InterestedPiecesResponse *InterestedPiecesResponse `protobuf:"bytes,1,opt,name=interested_pieces_response,json=interestedPiecesResponse,proto3,oneof"` + InterestedPiecesResponse *InterestedPiecesResponse `protobuf:"bytes,2,opt,name=interested_pieces_response,json=interestedPiecesResponse,proto3,oneof"` } +func (*SyncPiecesResponse_InterestedAllPiecesResponse) isSyncPiecesResponse_Response() {} + func (*SyncPiecesResponse_InterestedPiecesResponse) isSyncPiecesResponse_Response() {} // DownloadTaskRequest represents request of DownloadTask. @@ -347,7 +410,7 @@ type DownloadTaskRequest struct { func (x *DownloadTaskRequest) Reset() { *x = DownloadTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -360,7 +423,7 @@ func (x *DownloadTaskRequest) String() string { func (*DownloadTaskRequest) ProtoMessage() {} func (x *DownloadTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -373,7 +436,7 @@ func (x *DownloadTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DownloadTaskRequest.ProtoReflect.Descriptor instead. func (*DownloadTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6} } func (x *DownloadTaskRequest) GetDownload() *v2.Download { @@ -396,7 +459,7 @@ type UploadTaskRequest struct { func (x *UploadTaskRequest) Reset() { *x = UploadTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -409,7 +472,7 @@ func (x *UploadTaskRequest) String() string { func (*UploadTaskRequest) ProtoMessage() {} func (x *UploadTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -422,7 +485,7 @@ func (x *UploadTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadTaskRequest.ProtoReflect.Descriptor instead. func (*UploadTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7} } func (x *UploadTaskRequest) GetTask() *v2.Task { @@ -445,7 +508,7 @@ type StatTaskRequest struct { func (x *StatTaskRequest) Reset() { *x = StatTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -458,7 +521,7 @@ func (x *StatTaskRequest) String() string { func (*StatTaskRequest) ProtoMessage() {} func (x *StatTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -471,7 +534,7 @@ func (x *StatTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead. func (*StatTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{8} } func (x *StatTaskRequest) GetTaskId() string { @@ -494,7 +557,7 @@ type DeleteTaskRequest struct { func (x *DeleteTaskRequest) Reset() { *x = DeleteTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -507,7 +570,7 @@ func (x *DeleteTaskRequest) String() string { func (*DeleteTaskRequest) ProtoMessage() {} func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -520,7 +583,7 @@ func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead. func (*DeleteTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{8} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{9} } func (x *DeleteTaskRequest) GetTaskId() string { @@ -565,64 +628,76 @@ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc = []byte{ 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x50, 0x0a, 0x18, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, - 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x22, 0x8c, 0x01, - 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, - 0x00, 0x52, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0f, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x50, 0x0a, 0x13, - 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, - 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x42, - 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x61, - 0x73, 0x6b, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, - 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, 0xee, - 0x02, 0x0a, 0x08, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0a, 0x53, - 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x66, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x48, - 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x20, - 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, - 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x53, 0x0a, 0x1b, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, + 0x65, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, + 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, + 0x22, 0x50, 0x0a, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, + 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, + 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, + 0x65, 0x73, 0x22, 0xfd, 0x01, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x1e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, + 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x1a, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x0f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, + 0x42, 0x01, 0x22, 0x50, 0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x64, 0x6f, 0x77, + 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x42, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, + 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x61, 0x73, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, + 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x35, 0x0a, + 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, + 0x73, 0x6b, 0x49, 0x64, 0x32, 0xee, 0x02, 0x0a, 0x08, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x12, 0x51, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, + 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x28, 0x01, 0x30, 0x01, 0x12, 0x48, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x54, 0x61, 0x73, 0x6b, 0x12, 0x20, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, - 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1c, 0x2e, 0x64, 0x66, 0x64, - 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, - 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x44, 0x0a, 0x0a, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, - 0x2d, 0x5a, 0x2b, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, - 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, + 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, + 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, + 0x12, 0x1c, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x44, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, + 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2d, 0x5a, 0x2b, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, + 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x66, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -637,44 +712,47 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP() []byte { return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescData } -var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_goTypes = []interface{}{ - (*InterestedAllPiecesRequest)(nil), // 0: dfdaemon.v2.InterestedAllPiecesRequest - (*InterestedPiecesRequest)(nil), // 1: dfdaemon.v2.InterestedPiecesRequest - (*SyncPiecesRequest)(nil), // 2: dfdaemon.v2.SyncPiecesRequest - (*InterestedPiecesResponse)(nil), // 3: dfdaemon.v2.InterestedPiecesResponse - (*SyncPiecesResponse)(nil), // 4: dfdaemon.v2.SyncPiecesResponse - (*DownloadTaskRequest)(nil), // 5: dfdaemon.v2.DownloadTaskRequest - (*UploadTaskRequest)(nil), // 6: dfdaemon.v2.UploadTaskRequest - (*StatTaskRequest)(nil), // 7: dfdaemon.v2.StatTaskRequest - (*DeleteTaskRequest)(nil), // 8: dfdaemon.v2.DeleteTaskRequest - (*v2.Piece)(nil), // 9: common.v2.Piece - (*v2.Download)(nil), // 10: common.v2.Download - (*v2.Task)(nil), // 11: common.v2.Task - (*emptypb.Empty)(nil), // 12: google.protobuf.Empty + (*InterestedAllPiecesRequest)(nil), // 0: dfdaemon.v2.InterestedAllPiecesRequest + (*InterestedPiecesRequest)(nil), // 1: dfdaemon.v2.InterestedPiecesRequest + (*SyncPiecesRequest)(nil), // 2: dfdaemon.v2.SyncPiecesRequest + (*InterestedAllPiecesResponse)(nil), // 3: dfdaemon.v2.InterestedAllPiecesResponse + (*InterestedPiecesResponse)(nil), // 4: dfdaemon.v2.InterestedPiecesResponse + (*SyncPiecesResponse)(nil), // 5: dfdaemon.v2.SyncPiecesResponse + (*DownloadTaskRequest)(nil), // 6: dfdaemon.v2.DownloadTaskRequest + (*UploadTaskRequest)(nil), // 7: dfdaemon.v2.UploadTaskRequest + (*StatTaskRequest)(nil), // 8: dfdaemon.v2.StatTaskRequest + (*DeleteTaskRequest)(nil), // 9: dfdaemon.v2.DeleteTaskRequest + (*v2.Piece)(nil), // 10: common.v2.Piece + (*v2.Download)(nil), // 11: common.v2.Download + (*v2.Task)(nil), // 12: common.v2.Task + (*emptypb.Empty)(nil), // 13: google.protobuf.Empty } var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_depIdxs = []int32{ 0, // 0: dfdaemon.v2.SyncPiecesRequest.interested_all_pieces_request:type_name -> dfdaemon.v2.InterestedAllPiecesRequest 1, // 1: dfdaemon.v2.SyncPiecesRequest.interested_pieces_request:type_name -> dfdaemon.v2.InterestedPiecesRequest - 9, // 2: dfdaemon.v2.InterestedPiecesResponse.pieces:type_name -> common.v2.Piece - 3, // 3: dfdaemon.v2.SyncPiecesResponse.interested_pieces_response:type_name -> dfdaemon.v2.InterestedPiecesResponse - 10, // 4: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download - 11, // 5: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task - 2, // 6: dfdaemon.v2.Dfdaemon.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest - 5, // 7: dfdaemon.v2.Dfdaemon.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest - 6, // 8: dfdaemon.v2.Dfdaemon.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest - 7, // 9: dfdaemon.v2.Dfdaemon.StatTask:input_type -> dfdaemon.v2.StatTaskRequest - 8, // 10: dfdaemon.v2.Dfdaemon.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest - 4, // 11: dfdaemon.v2.Dfdaemon.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse - 12, // 12: dfdaemon.v2.Dfdaemon.DownloadTask:output_type -> google.protobuf.Empty - 12, // 13: dfdaemon.v2.Dfdaemon.UploadTask:output_type -> google.protobuf.Empty - 11, // 14: dfdaemon.v2.Dfdaemon.StatTask:output_type -> common.v2.Task - 12, // 15: dfdaemon.v2.Dfdaemon.DeleteTask:output_type -> google.protobuf.Empty - 11, // [11:16] is the sub-list for method output_type - 6, // [6:11] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 2: dfdaemon.v2.InterestedAllPiecesResponse.pieces:type_name -> common.v2.Piece + 10, // 3: dfdaemon.v2.InterestedPiecesResponse.pieces:type_name -> common.v2.Piece + 3, // 4: dfdaemon.v2.SyncPiecesResponse.interested_all_pieces_response:type_name -> dfdaemon.v2.InterestedAllPiecesResponse + 4, // 5: dfdaemon.v2.SyncPiecesResponse.interested_pieces_response:type_name -> dfdaemon.v2.InterestedPiecesResponse + 11, // 6: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download + 12, // 7: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task + 2, // 8: dfdaemon.v2.Dfdaemon.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest + 6, // 9: dfdaemon.v2.Dfdaemon.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest + 7, // 10: dfdaemon.v2.Dfdaemon.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest + 8, // 11: dfdaemon.v2.Dfdaemon.StatTask:input_type -> dfdaemon.v2.StatTaskRequest + 9, // 12: dfdaemon.v2.Dfdaemon.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest + 5, // 13: dfdaemon.v2.Dfdaemon.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse + 13, // 14: dfdaemon.v2.Dfdaemon.DownloadTask:output_type -> google.protobuf.Empty + 13, // 15: dfdaemon.v2.Dfdaemon.UploadTask:output_type -> google.protobuf.Empty + 12, // 16: dfdaemon.v2.Dfdaemon.StatTask:output_type -> common.v2.Task + 13, // 17: dfdaemon.v2.Dfdaemon.DeleteTask:output_type -> google.protobuf.Empty + 13, // [13:18] is the sub-list for method output_type + 8, // [8:13] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() } @@ -720,7 +798,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InterestedPiecesResponse); i { + switch v := v.(*InterestedAllPiecesResponse); i { case 0: return &v.state case 1: @@ -732,7 +810,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncPiecesResponse); i { + switch v := v.(*InterestedPiecesResponse); i { case 0: return &v.state case 1: @@ -744,7 +822,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownloadTaskRequest); i { + switch v := v.(*SyncPiecesResponse); i { case 0: return &v.state case 1: @@ -756,7 +834,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadTaskRequest); i { + switch v := v.(*DownloadTaskRequest); i { case 0: return &v.state case 1: @@ -768,7 +846,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatTaskRequest); i { + switch v := v.(*UploadTaskRequest); i { case 0: return &v.state case 1: @@ -780,6 +858,18 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatTaskRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTaskRequest); i { case 0: return &v.state @@ -796,7 +886,8 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { (*SyncPiecesRequest_InterestedAllPiecesRequest)(nil), (*SyncPiecesRequest_InterestedPiecesRequest)(nil), } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4].OneofWrappers = []interface{}{ + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*SyncPiecesResponse_InterestedAllPiecesResponse)(nil), (*SyncPiecesResponse_InterestedPiecesResponse)(nil), } type x struct{} @@ -805,7 +896,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go b/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go index f8e7542c..b0cb22d1 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go +++ b/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go @@ -463,6 +463,158 @@ var _ interface { ErrorName() string } = SyncPiecesRequestValidationError{} +// Validate checks the field values on InterestedAllPiecesResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *InterestedAllPiecesResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on InterestedAllPiecesResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// InterestedAllPiecesResponseMultiError, or nil if none found. +func (m *InterestedAllPiecesResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *InterestedAllPiecesResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(m.GetPieces()) > 0 { + + if len(m.GetPieces()) < 1 { + err := InterestedAllPiecesResponseValidationError{ + field: "Pieces", + reason: "value must contain at least 1 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetPieces() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, InterestedAllPiecesResponseValidationError{ + field: fmt.Sprintf("Pieces[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, InterestedAllPiecesResponseValidationError{ + field: fmt.Sprintf("Pieces[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return InterestedAllPiecesResponseValidationError{ + field: fmt.Sprintf("Pieces[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + } + + if len(errors) > 0 { + return InterestedAllPiecesResponseMultiError(errors) + } + + return nil +} + +// InterestedAllPiecesResponseMultiError is an error wrapping multiple +// validation errors returned by InterestedAllPiecesResponse.ValidateAll() if +// the designated constraints aren't met. +type InterestedAllPiecesResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m InterestedAllPiecesResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m InterestedAllPiecesResponseMultiError) AllErrors() []error { return m } + +// InterestedAllPiecesResponseValidationError is the validation error returned +// by InterestedAllPiecesResponse.Validate if the designated constraints +// aren't met. +type InterestedAllPiecesResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e InterestedAllPiecesResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e InterestedAllPiecesResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e InterestedAllPiecesResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e InterestedAllPiecesResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e InterestedAllPiecesResponseValidationError) ErrorName() string { + return "InterestedAllPiecesResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e InterestedAllPiecesResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sInterestedAllPiecesResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = InterestedAllPiecesResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = InterestedAllPiecesResponseValidationError{} + // Validate checks the field values on InterestedPiecesResponse with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. @@ -638,6 +790,48 @@ func (m *SyncPiecesResponse) validate(all bool) error { oneofResponsePresent := false switch v := m.Response.(type) { + case *SyncPiecesResponse_InterestedAllPiecesResponse: + if v == nil { + err := SyncPiecesResponseValidationError{ + field: "Response", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofResponsePresent = true + + if all { + switch v := interface{}(m.GetInterestedAllPiecesResponse()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SyncPiecesResponseValidationError{ + field: "InterestedAllPiecesResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SyncPiecesResponseValidationError{ + field: "InterestedAllPiecesResponse", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetInterestedAllPiecesResponse()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SyncPiecesResponseValidationError{ + field: "InterestedAllPiecesResponse", + reason: "embedded message failed validation", + cause: err, + } + } + } + case *SyncPiecesResponse_InterestedPiecesResponse: if v == nil { err := SyncPiecesResponseValidationError{ diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.proto b/pkg/apis/dfdaemon/v2/dfdaemon.proto index 6e9fc164..ac364064 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.proto +++ b/pkg/apis/dfdaemon/v2/dfdaemon.proto @@ -47,6 +47,12 @@ message SyncPiecesRequest{ } } +// InterestedPiecesResponse represents all pieces response of SyncPiecesResponse. +message InterestedAllPiecesResponse { + // All of the pieces in task. + repeated common.v2.Piece pieces = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; +} + // InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. message InterestedPiecesResponse { // Interested pieces of task. @@ -58,7 +64,8 @@ message SyncPiecesResponse { oneof response { option (validate.required) = true; - InterestedPiecesResponse interested_pieces_response = 1; + InterestedAllPiecesResponse interested_all_pieces_response = 1; + InterestedPiecesResponse interested_pieces_response = 2; } } diff --git a/proto/dfdaemon.proto b/proto/dfdaemon.proto index bb710dad..b346837a 100644 --- a/proto/dfdaemon.proto +++ b/proto/dfdaemon.proto @@ -42,6 +42,12 @@ message SyncPiecesRequest{ } } +// InterestedPiecesResponse represents all pieces response of SyncPiecesResponse. +message InterestedAllPiecesResponse { + // All of the pieces in task. + repeated common.v2.Piece pieces = 1; +} + // InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. message InterestedPiecesResponse { // Interested pieces of task. @@ -51,7 +57,8 @@ message InterestedPiecesResponse { // SyncPiecesResponse represents response of SyncPieces. message SyncPiecesResponse { oneof response { - InterestedPiecesResponse interested_pieces_response = 1; + InterestedAllPiecesResponse interested_all_pieces_response = 1; + InterestedPiecesResponse interested_pieces_response = 2; } } diff --git a/src/descriptor.bin b/src/descriptor.bin index 35334a74..479b5b75 100644 Binary files a/src/descriptor.bin and b/src/descriptor.bin differ diff --git a/src/dfdaemon.v2.rs b/src/dfdaemon.v2.rs index 712c6684..6367c2fe 100644 --- a/src/dfdaemon.v2.rs +++ b/src/dfdaemon.v2.rs @@ -35,6 +35,15 @@ pub mod sync_pieces_request { InterestedPiecesRequest(super::InterestedPiecesRequest), } } +/// InterestedPiecesResponse represents all pieces response of SyncPiecesResponse. +#[derive(serde::Serialize, serde::Deserialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterestedAllPiecesResponse { + /// All of the pieces in task. + #[prost(message, repeated, tag = "1")] + pub pieces: ::prost::alloc::vec::Vec, +} /// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] @@ -49,7 +58,7 @@ pub struct InterestedPiecesResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SyncPiecesResponse { - #[prost(oneof = "sync_pieces_response::Response", tags = "1")] + #[prost(oneof = "sync_pieces_response::Response", tags = "1, 2")] pub response: ::core::option::Option, } /// Nested message and enum types in `SyncPiecesResponse`. @@ -59,6 +68,8 @@ pub mod sync_pieces_response { #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { #[prost(message, tag = "1")] + InterestedAllPiecesResponse(super::InterestedAllPiecesResponse), + #[prost(message, tag = "2")] InterestedPiecesResponse(super::InterestedPiecesResponse), } }