feat: add started response in DownloadTaskResponse (#234)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2023-12-19 14:30:29 +08:00 committed by GitHub
parent 495349e279
commit ef28f45764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 741 additions and 211 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.0.65"
version = "2.0.66"
authors = ["Gaius <gaius.qi@gmail.com>"]
edition = "2021"
license = "Apache-2.0"

View File

@ -87,6 +87,104 @@ func (x *DownloadTaskRequest) GetDownload() *v2.Download {
return nil
}
// DownloadTaskStartedResponse represents task started response of DownloadTaskResponse.
type DownloadTaskStartedResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task content length.
ContentLength uint64 `protobuf:"varint,1,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
}
func (x *DownloadTaskStartedResponse) Reset() {
*x = DownloadTaskStartedResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadTaskStartedResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadTaskStartedResponse) ProtoMessage() {}
func (x *DownloadTaskStartedResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_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 DownloadTaskStartedResponse.ProtoReflect.Descriptor instead.
func (*DownloadTaskStartedResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{1}
}
func (x *DownloadTaskStartedResponse) GetContentLength() uint64 {
if x != nil {
return x.ContentLength
}
return 0
}
// DownloadPieceFinishedResponse represents piece finished response of DownloadTaskResponse.
type DownloadPieceFinishedResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Piece info.
Piece *v2.Piece `protobuf:"bytes,1,opt,name=piece,proto3" json:"piece,omitempty"`
}
func (x *DownloadPieceFinishedResponse) Reset() {
*x = DownloadPieceFinishedResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadPieceFinishedResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadPieceFinishedResponse) ProtoMessage() {}
func (x *DownloadPieceFinishedResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_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 DownloadPieceFinishedResponse.ProtoReflect.Descriptor instead.
func (*DownloadPieceFinishedResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{2}
}
func (x *DownloadPieceFinishedResponse) GetPiece() *v2.Piece {
if x != nil {
return x.Piece
}
return nil
}
// DownloadTaskResponse represents response of DownloadTask.
type DownloadTaskResponse struct {
state protoimpl.MessageState
@ -99,16 +197,17 @@ type DownloadTaskResponse struct {
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// Peer id.
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
// Task content length.
ContentLength uint64 `protobuf:"varint,4,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"`
// Finished piece of task.
Piece *v2.Piece `protobuf:"bytes,5,opt,name=piece,proto3" json:"piece,omitempty"`
// Types that are assignable to Response:
//
// *DownloadTaskResponse_DownloadTaskStartedResponse
// *DownloadTaskResponse_DownloadPieceFinishedResponse
Response isDownloadTaskResponse_Response `protobuf_oneof:"response"`
}
func (x *DownloadTaskResponse) Reset() {
*x = DownloadTaskResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[1]
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -121,7 +220,7 @@ func (x *DownloadTaskResponse) String() string {
func (*DownloadTaskResponse) ProtoMessage() {}
func (x *DownloadTaskResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[1]
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 {
@ -134,7 +233,7 @@ func (x *DownloadTaskResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownloadTaskResponse.ProtoReflect.Descriptor instead.
func (*DownloadTaskResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{1}
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{3}
}
func (x *DownloadTaskResponse) GetHostId() string {
@ -158,20 +257,43 @@ func (x *DownloadTaskResponse) GetPeerId() string {
return ""
}
func (x *DownloadTaskResponse) GetContentLength() uint64 {
if x != nil {
return x.ContentLength
}
return 0
}
func (x *DownloadTaskResponse) GetPiece() *v2.Piece {
if x != nil {
return x.Piece
func (m *DownloadTaskResponse) GetResponse() isDownloadTaskResponse_Response {
if m != nil {
return m.Response
}
return nil
}
func (x *DownloadTaskResponse) GetDownloadTaskStartedResponse() *DownloadTaskStartedResponse {
if x, ok := x.GetResponse().(*DownloadTaskResponse_DownloadTaskStartedResponse); ok {
return x.DownloadTaskStartedResponse
}
return nil
}
func (x *DownloadTaskResponse) GetDownloadPieceFinishedResponse() *DownloadPieceFinishedResponse {
if x, ok := x.GetResponse().(*DownloadTaskResponse_DownloadPieceFinishedResponse); ok {
return x.DownloadPieceFinishedResponse
}
return nil
}
type isDownloadTaskResponse_Response interface {
isDownloadTaskResponse_Response()
}
type DownloadTaskResponse_DownloadTaskStartedResponse struct {
DownloadTaskStartedResponse *DownloadTaskStartedResponse `protobuf:"bytes,4,opt,name=download_task_started_response,json=downloadTaskStartedResponse,proto3,oneof"`
}
type DownloadTaskResponse_DownloadPieceFinishedResponse struct {
DownloadPieceFinishedResponse *DownloadPieceFinishedResponse `protobuf:"bytes,5,opt,name=download_piece_finished_response,json=downloadPieceFinishedResponse,proto3,oneof"`
}
func (*DownloadTaskResponse_DownloadTaskStartedResponse) isDownloadTaskResponse_Response() {}
func (*DownloadTaskResponse_DownloadPieceFinishedResponse) isDownloadTaskResponse_Response() {}
// SyncPiecesRequest represents request of SyncPieces.
type SyncPiecesRequest struct {
state protoimpl.MessageState
@ -187,7 +309,7 @@ type SyncPiecesRequest struct {
func (x *SyncPiecesRequest) Reset() {
*x = SyncPiecesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2]
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -200,7 +322,7 @@ func (x *SyncPiecesRequest) String() string {
func (*SyncPiecesRequest) ProtoMessage() {}
func (x *SyncPiecesRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2]
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 {
@ -213,7 +335,7 @@ func (x *SyncPiecesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncPiecesRequest.ProtoReflect.Descriptor instead.
func (*SyncPiecesRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{2}
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4}
}
func (x *SyncPiecesRequest) GetTaskId() string {
@ -243,7 +365,7 @@ type SyncPiecesResponse struct {
func (x *SyncPiecesResponse) Reset() {
*x = SyncPiecesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3]
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -256,7 +378,7 @@ func (x *SyncPiecesResponse) String() string {
func (*SyncPiecesResponse) ProtoMessage() {}
func (x *SyncPiecesResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3]
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 {
@ -269,7 +391,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{3}
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5}
}
func (x *SyncPiecesResponse) GetPieceNumber() uint32 {
@ -294,7 +416,7 @@ type DownloadPieceRequest struct {
func (x *DownloadPieceRequest) Reset() {
*x = DownloadPieceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4]
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -307,7 +429,7 @@ func (x *DownloadPieceRequest) String() string {
func (*DownloadPieceRequest) ProtoMessage() {}
func (x *DownloadPieceRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4]
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 {
@ -320,7 +442,7 @@ func (x *DownloadPieceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownloadPieceRequest.ProtoReflect.Descriptor instead.
func (*DownloadPieceRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4}
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6}
}
func (x *DownloadPieceRequest) GetTaskId() string {
@ -350,7 +472,7 @@ type DownloadPieceResponse struct {
func (x *DownloadPieceResponse) Reset() {
*x = DownloadPieceResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5]
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -363,7 +485,7 @@ func (x *DownloadPieceResponse) String() string {
func (*DownloadPieceResponse) ProtoMessage() {}
func (x *DownloadPieceResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5]
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 {
@ -376,7 +498,7 @@ func (x *DownloadPieceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownloadPieceResponse.ProtoReflect.Descriptor instead.
func (*DownloadPieceResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5}
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7}
}
func (x *DownloadPieceResponse) GetPiece() *v2.Piece {
@ -399,7 +521,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[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -412,7 +534,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[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -425,7 +547,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{8}
}
func (x *UploadTaskRequest) GetTask() *v2.Task {
@ -448,7 +570,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[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -461,7 +583,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[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -474,7 +596,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{9}
}
func (x *StatTaskRequest) GetTaskId() string {
@ -497,7 +619,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[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -510,7 +632,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[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -523,7 +645,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{10}
}
func (x *DeleteTaskRequest) GetTaskId() string {
@ -549,93 +671,113 @@ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc = []byte{
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, 0xd5, 0x01, 0x0a, 0x14,
0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06,
0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72,
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01,
0x01, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x44, 0x0a, 0x1b, 0x44,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74,
0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74,
0x68, 0x12, 0x30, 0x0a, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65,
0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x70, 0x69,
0x65, 0x63, 0x65, 0x22, 0x79, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b,
0x68, 0x22, 0x51, 0x0a, 0x1d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65,
0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69,
0x65, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x70,
0x69, 0x65, 0x63, 0x65, 0x22, 0xf5, 0x02, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a,
0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12,
0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49,
0x64, 0x12, 0x20, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x65, 0x65,
0x72, 0x49, 0x64, 0x12, 0x6f, 0x0a, 0x1e, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f,
0x74, 0x61, 0x73, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 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, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61,
0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f,
0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a,
0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77,
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68,
0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1d, 0x64, 0x6f,
0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73,
0x68, 0x65, 0x64, 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, 0x79, 0x0a, 0x11,
0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 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, 0x12, 0x42, 0x0a, 0x18, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65,
0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x0d, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52,
0x16, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65,
0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x37, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x50,
0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a,
0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x22, 0x5b, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63,
0x65, 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, 0x12, 0x42, 0x0a, 0x18, 0x69, 0x6e,
0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x42, 0x08, 0xfa, 0x42,
0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x16, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74,
0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x37,
0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63,
0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c,
0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69,
0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x49, 0x0a,
0x15, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76,
0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10,
0x01, 0x52, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 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, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x15, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a,
0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x08,
0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 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,
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, 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,
0x90, 0x02, 0x0a, 0x0e, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f,
0x61, 0x64, 0x12, 0x55, 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, 0x21, 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, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x4f, 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, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x44, 0x6f,
0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x64, 0x66,
0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, 0x90, 0x02, 0x0a, 0x0e, 0x44, 0x66, 0x64,
0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x55, 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, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22,
0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77,
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x32, 0xb0, 0x02, 0x0a, 0x10, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x44,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x55, 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, 0x21, 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, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 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,
0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 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, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x30, 0x01, 0x12, 0x4f, 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, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50,
0x69, 0x65, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e,
0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d,
0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69,
0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb0, 0x02, 0x0a, 0x10,
0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x12, 0x55, 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, 0x21, 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, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 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 (
@ -650,46 +792,50 @@ 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, 11)
var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_goTypes = []interface{}{
(*DownloadTaskRequest)(nil), // 0: dfdaemon.v2.DownloadTaskRequest
(*DownloadTaskResponse)(nil), // 1: dfdaemon.v2.DownloadTaskResponse
(*SyncPiecesRequest)(nil), // 2: dfdaemon.v2.SyncPiecesRequest
(*SyncPiecesResponse)(nil), // 3: dfdaemon.v2.SyncPiecesResponse
(*DownloadPieceRequest)(nil), // 4: dfdaemon.v2.DownloadPieceRequest
(*DownloadPieceResponse)(nil), // 5: dfdaemon.v2.DownloadPieceResponse
(*UploadTaskRequest)(nil), // 6: dfdaemon.v2.UploadTaskRequest
(*StatTaskRequest)(nil), // 7: dfdaemon.v2.StatTaskRequest
(*DeleteTaskRequest)(nil), // 8: dfdaemon.v2.DeleteTaskRequest
(*v2.Download)(nil), // 9: common.v2.Download
(*v2.Piece)(nil), // 10: common.v2.Piece
(*v2.Task)(nil), // 11: common.v2.Task
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
(*DownloadTaskRequest)(nil), // 0: dfdaemon.v2.DownloadTaskRequest
(*DownloadTaskStartedResponse)(nil), // 1: dfdaemon.v2.DownloadTaskStartedResponse
(*DownloadPieceFinishedResponse)(nil), // 2: dfdaemon.v2.DownloadPieceFinishedResponse
(*DownloadTaskResponse)(nil), // 3: dfdaemon.v2.DownloadTaskResponse
(*SyncPiecesRequest)(nil), // 4: dfdaemon.v2.SyncPiecesRequest
(*SyncPiecesResponse)(nil), // 5: dfdaemon.v2.SyncPiecesResponse
(*DownloadPieceRequest)(nil), // 6: dfdaemon.v2.DownloadPieceRequest
(*DownloadPieceResponse)(nil), // 7: dfdaemon.v2.DownloadPieceResponse
(*UploadTaskRequest)(nil), // 8: dfdaemon.v2.UploadTaskRequest
(*StatTaskRequest)(nil), // 9: dfdaemon.v2.StatTaskRequest
(*DeleteTaskRequest)(nil), // 10: dfdaemon.v2.DeleteTaskRequest
(*v2.Download)(nil), // 11: common.v2.Download
(*v2.Piece)(nil), // 12: common.v2.Piece
(*v2.Task)(nil), // 13: common.v2.Task
(*emptypb.Empty)(nil), // 14: google.protobuf.Empty
}
var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_depIdxs = []int32{
9, // 0: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download
10, // 1: dfdaemon.v2.DownloadTaskResponse.piece:type_name -> common.v2.Piece
10, // 2: dfdaemon.v2.DownloadPieceResponse.piece:type_name -> common.v2.Piece
11, // 3: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task
0, // 4: dfdaemon.v2.DfdaemonUpload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest
2, // 5: dfdaemon.v2.DfdaemonUpload.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest
4, // 6: dfdaemon.v2.DfdaemonUpload.DownloadPiece:input_type -> dfdaemon.v2.DownloadPieceRequest
0, // 7: dfdaemon.v2.DfdaemonDownload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest
6, // 8: dfdaemon.v2.DfdaemonDownload.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest
7, // 9: dfdaemon.v2.DfdaemonDownload.StatTask:input_type -> dfdaemon.v2.StatTaskRequest
8, // 10: dfdaemon.v2.DfdaemonDownload.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest
1, // 11: dfdaemon.v2.DfdaemonUpload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse
3, // 12: dfdaemon.v2.DfdaemonUpload.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse
5, // 13: dfdaemon.v2.DfdaemonUpload.DownloadPiece:output_type -> dfdaemon.v2.DownloadPieceResponse
1, // 14: dfdaemon.v2.DfdaemonDownload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse
12, // 15: dfdaemon.v2.DfdaemonDownload.UploadTask:output_type -> google.protobuf.Empty
11, // 16: dfdaemon.v2.DfdaemonDownload.StatTask:output_type -> common.v2.Task
12, // 17: dfdaemon.v2.DfdaemonDownload.DeleteTask:output_type -> google.protobuf.Empty
11, // [11:18] is the sub-list for method output_type
4, // [4:11] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
11, // 0: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download
12, // 1: dfdaemon.v2.DownloadPieceFinishedResponse.piece:type_name -> common.v2.Piece
1, // 2: dfdaemon.v2.DownloadTaskResponse.download_task_started_response:type_name -> dfdaemon.v2.DownloadTaskStartedResponse
2, // 3: dfdaemon.v2.DownloadTaskResponse.download_piece_finished_response:type_name -> dfdaemon.v2.DownloadPieceFinishedResponse
12, // 4: dfdaemon.v2.DownloadPieceResponse.piece:type_name -> common.v2.Piece
13, // 5: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task
0, // 6: dfdaemon.v2.DfdaemonUpload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest
4, // 7: dfdaemon.v2.DfdaemonUpload.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest
6, // 8: dfdaemon.v2.DfdaemonUpload.DownloadPiece:input_type -> dfdaemon.v2.DownloadPieceRequest
0, // 9: dfdaemon.v2.DfdaemonDownload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest
8, // 10: dfdaemon.v2.DfdaemonDownload.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest
9, // 11: dfdaemon.v2.DfdaemonDownload.StatTask:input_type -> dfdaemon.v2.StatTaskRequest
10, // 12: dfdaemon.v2.DfdaemonDownload.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest
3, // 13: dfdaemon.v2.DfdaemonUpload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse
5, // 14: dfdaemon.v2.DfdaemonUpload.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse
7, // 15: dfdaemon.v2.DfdaemonUpload.DownloadPiece:output_type -> dfdaemon.v2.DownloadPieceResponse
3, // 16: dfdaemon.v2.DfdaemonDownload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse
14, // 17: dfdaemon.v2.DfdaemonDownload.UploadTask:output_type -> google.protobuf.Empty
13, // 18: dfdaemon.v2.DfdaemonDownload.StatTask:output_type -> common.v2.Task
14, // 19: dfdaemon.v2.DfdaemonDownload.DeleteTask:output_type -> google.protobuf.Empty
13, // [13:20] is the sub-list for method output_type
6, // [6:13] 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
}
func init() { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() }
@ -711,7 +857,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() {
}
}
file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloadTaskResponse); i {
switch v := v.(*DownloadTaskStartedResponse); i {
case 0:
return &v.state
case 1:
@ -723,7 +869,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() {
}
}
file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SyncPiecesRequest); i {
switch v := v.(*DownloadPieceFinishedResponse); i {
case 0:
return &v.state
case 1:
@ -735,7 +881,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.(*SyncPiecesResponse); i {
switch v := v.(*DownloadTaskResponse); i {
case 0:
return &v.state
case 1:
@ -747,7 +893,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.(*DownloadPieceRequest); i {
switch v := v.(*SyncPiecesRequest); i {
case 0:
return &v.state
case 1:
@ -759,7 +905,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.(*DownloadPieceResponse); i {
switch v := v.(*SyncPiecesResponse); i {
case 0:
return &v.state
case 1:
@ -771,7 +917,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.(*DownloadPieceRequest); i {
case 0:
return &v.state
case 1:
@ -783,7 +929,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.(*DownloadPieceResponse); i {
case 0:
return &v.state
case 1:
@ -795,6 +941,30 @@ 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.(*UploadTaskRequest); 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.(*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[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteTaskRequest); i {
case 0:
return &v.state
@ -807,13 +977,17 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() {
}
}
}
file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3].OneofWrappers = []interface{}{
(*DownloadTaskResponse_DownloadTaskStartedResponse)(nil),
(*DownloadTaskResponse_DownloadPieceFinishedResponse)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc,
NumEnums: 0,
NumMessages: 9,
NumMessages: 11,
NumExtensions: 0,
NumServices: 2,
},

View File

@ -177,6 +177,254 @@ var _ interface {
ErrorName() string
} = DownloadTaskRequestValidationError{}
// Validate checks the field values on DownloadTaskStartedResponse 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 *DownloadTaskStartedResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadTaskStartedResponse 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
// DownloadTaskStartedResponseMultiError, or nil if none found.
func (m *DownloadTaskStartedResponse) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadTaskStartedResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for ContentLength
if len(errors) > 0 {
return DownloadTaskStartedResponseMultiError(errors)
}
return nil
}
// DownloadTaskStartedResponseMultiError is an error wrapping multiple
// validation errors returned by DownloadTaskStartedResponse.ValidateAll() if
// the designated constraints aren't met.
type DownloadTaskStartedResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadTaskStartedResponseMultiError) 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 DownloadTaskStartedResponseMultiError) AllErrors() []error { return m }
// DownloadTaskStartedResponseValidationError is the validation error returned
// by DownloadTaskStartedResponse.Validate if the designated constraints
// aren't met.
type DownloadTaskStartedResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadTaskStartedResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadTaskStartedResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadTaskStartedResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadTaskStartedResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadTaskStartedResponseValidationError) ErrorName() string {
return "DownloadTaskStartedResponseValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadTaskStartedResponseValidationError) 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 %sDownloadTaskStartedResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadTaskStartedResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadTaskStartedResponseValidationError{}
// Validate checks the field values on DownloadPieceFinishedResponse 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 *DownloadPieceFinishedResponse) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadPieceFinishedResponse 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
// DownloadPieceFinishedResponseMultiError, or nil if none found.
func (m *DownloadPieceFinishedResponse) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadPieceFinishedResponse) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.GetPiece() == nil {
err := DownloadPieceFinishedResponseValidationError{
field: "Piece",
reason: "value is required",
}
if !all {
return err
}
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetPiece()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadPieceFinishedResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadPieceFinishedResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetPiece()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadPieceFinishedResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return DownloadPieceFinishedResponseMultiError(errors)
}
return nil
}
// DownloadPieceFinishedResponseMultiError is an error wrapping multiple
// validation errors returned by DownloadPieceFinishedResponse.ValidateAll()
// if the designated constraints aren't met.
type DownloadPieceFinishedResponseMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadPieceFinishedResponseMultiError) 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 DownloadPieceFinishedResponseMultiError) AllErrors() []error { return m }
// DownloadPieceFinishedResponseValidationError is the validation error
// returned by DownloadPieceFinishedResponse.Validate if the designated
// constraints aren't met.
type DownloadPieceFinishedResponseValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadPieceFinishedResponseValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadPieceFinishedResponseValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadPieceFinishedResponseValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadPieceFinishedResponseValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadPieceFinishedResponseValidationError) ErrorName() string {
return "DownloadPieceFinishedResponseValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadPieceFinishedResponseValidationError) 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 %sDownloadPieceFinishedResponse.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadPieceFinishedResponseValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadPieceFinishedResponseValidationError{}
// Validate checks the field values on DownloadTaskResponse 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.
@ -232,11 +480,98 @@ func (m *DownloadTaskResponse) validate(all bool) error {
errors = append(errors, err)
}
// no validation rules for ContentLength
oneofResponsePresent := false
switch v := m.Response.(type) {
case *DownloadTaskResponse_DownloadTaskStartedResponse:
if v == nil {
err := DownloadTaskResponseValidationError{
field: "Response",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofResponsePresent = true
if m.GetPiece() == nil {
if all {
switch v := interface{}(m.GetDownloadTaskStartedResponse()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskStartedResponse",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskStartedResponse",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDownloadTaskStartedResponse()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "DownloadTaskStartedResponse",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *DownloadTaskResponse_DownloadPieceFinishedResponse:
if v == nil {
err := DownloadTaskResponseValidationError{
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.GetDownloadPieceFinishedResponse()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedResponse",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedResponse",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDownloadPieceFinishedResponse()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedResponse",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if !oneofResponsePresent {
err := DownloadTaskResponseValidationError{
field: "Piece",
field: "Response",
reason: "value is required",
}
if !all {
@ -245,35 +580,6 @@ func (m *DownloadTaskResponse) validate(all bool) error {
errors = append(errors, err)
}
if all {
switch v := interface{}(m.GetPiece()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetPiece()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return DownloadTaskResponseMultiError(errors)
}

View File

@ -30,6 +30,18 @@ message DownloadTaskRequest {
common.v2.Download download = 1 [(validate.rules).message.required = true];
}
// DownloadTaskStartedResponse represents task started response of DownloadTaskResponse.
message DownloadTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadPieceFinishedResponse represents piece finished response of DownloadTaskResponse.
message DownloadPieceFinishedResponse {
// Piece info.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}
// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Host id.
@ -41,11 +53,12 @@ message DownloadTaskResponse {
// Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1];
// Task content length.
uint64 content_length = 4;
oneof response {
option (validate.required) = true;
// Finished piece of task.
common.v2.Piece piece = 5 [(validate.rules).message.required = true];
DownloadTaskStartedResponse download_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// SyncPiecesRequest represents request of SyncPieces.

View File

@ -27,6 +27,18 @@ message DownloadTaskRequest {
common.v2.Download download = 1;
}
// DownloadTaskStartedResponse represents task started response of DownloadTaskResponse.
message DownloadTaskStartedResponse {
// Task content length.
uint64 content_length = 1;
}
// DownloadPieceFinishedResponse represents piece finished response of DownloadTaskResponse.
message DownloadPieceFinishedResponse {
// Piece info.
common.v2.Piece piece = 1;
}
// DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse {
// Host id.
@ -38,11 +50,10 @@ message DownloadTaskResponse {
// Peer id.
string peer_id = 3;
// Task content length.
uint64 content_length = 4;
// Finished piece of task.
common.v2.Piece piece = 5;
oneof response {
DownloadTaskStartedResponse download_task_started_response = 4;
DownloadPieceFinishedResponse download_piece_finished_response = 5;
}
}
// SyncPiecesRequest represents request of SyncPieces.

Binary file not shown.

View File

@ -7,6 +7,24 @@ pub struct DownloadTaskRequest {
#[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::super::common::v2::Download>,
}
/// DownloadTaskStartedResponse represents task started response of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskStartedResponse {
/// Task content length.
#[prost(uint64, tag = "1")]
pub content_length: u64,
}
/// DownloadPieceFinishedResponse represents piece finished response of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceFinishedResponse {
/// Piece info.
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
/// DownloadTaskResponse represents response of DownloadTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
@ -21,12 +39,20 @@ pub struct DownloadTaskResponse {
/// Peer id.
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
/// Task content length.
#[prost(uint64, tag = "4")]
pub content_length: u64,
/// Finished piece of task.
#[prost(message, optional, tag = "5")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
#[prost(oneof = "download_task_response::Response", tags = "4, 5")]
pub response: ::core::option::Option<download_task_response::Response>,
}
/// Nested message and enum types in `DownloadTaskResponse`.
pub mod download_task_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "4")]
DownloadTaskStartedResponse(super::DownloadTaskStartedResponse),
#[prost(message, tag = "5")]
DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
}
}
/// SyncPiecesRequest represents request of SyncPieces.
#[derive(serde::Serialize, serde::Deserialize)]