feat: add started and finished to download task response (#262)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2024-01-29 16:54:39 +08:00 committed by GitHub
parent 38e6942032
commit 62716164e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 958 additions and 187 deletions

2
Cargo.lock generated
View File

@ -160,7 +160,7 @@ dependencies = [
[[package]] [[package]]
name = "dragonfly-api" name = "dragonfly-api"
version = "2.0.85" version = "2.0.86"
dependencies = [ dependencies = [
"prost 0.11.9", "prost 0.11.9",
"prost-types 0.12.3", "prost-types 0.12.3",

View File

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

View File

@ -368,6 +368,143 @@ func (x *DownloadTaskRequest) GetDownload() *v2.Download {
return nil return nil
} }
// DownloadTaskStartedRequest represents task download started request of DownloadTaskResponse.
type DownloadTaskStartedRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Task response headers.
ResponseHeader map[string]string `protobuf:"bytes,1,rep,name=response_header,json=responseHeader,proto3" json:"response_header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *DownloadTaskStartedRequest) Reset() {
*x = DownloadTaskStartedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadTaskStartedRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadTaskStartedRequest) ProtoMessage() {}
func (x *DownloadTaskStartedRequest) ProtoReflect() protoreflect.Message {
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 {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DownloadTaskStartedRequest.ProtoReflect.Descriptor instead.
func (*DownloadTaskStartedRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6}
}
func (x *DownloadTaskStartedRequest) GetResponseHeader() map[string]string {
if x != nil {
return x.ResponseHeader
}
return nil
}
// DownloadTaskFinishedRequest represents task download finished request of DownloadTaskResponse.
type DownloadTaskFinishedRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DownloadTaskFinishedRequest) Reset() {
*x = DownloadTaskFinishedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadTaskFinishedRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadTaskFinishedRequest) ProtoMessage() {}
func (x *DownloadTaskFinishedRequest) ProtoReflect() protoreflect.Message {
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 {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DownloadTaskFinishedRequest.ProtoReflect.Descriptor instead.
func (*DownloadTaskFinishedRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7}
}
// DownloadPieceFinishedRequest represents piece download finished request of DownloadTaskResponse.
type DownloadPieceFinishedRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Finished piece of task.
Piece *v2.Piece `protobuf:"bytes,1,opt,name=piece,proto3" json:"piece,omitempty"`
}
func (x *DownloadPieceFinishedRequest) Reset() {
*x = DownloadPieceFinishedRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DownloadPieceFinishedRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DownloadPieceFinishedRequest) ProtoMessage() {}
func (x *DownloadPieceFinishedRequest) ProtoReflect() protoreflect.Message {
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 {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DownloadPieceFinishedRequest.ProtoReflect.Descriptor instead.
func (*DownloadPieceFinishedRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{8}
}
func (x *DownloadPieceFinishedRequest) GetPiece() *v2.Piece {
if x != nil {
return x.Piece
}
return nil
}
// DownloadTaskResponse represents response of DownloadTask. // DownloadTaskResponse represents response of DownloadTask.
type DownloadTaskResponse struct { type DownloadTaskResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -380,16 +517,18 @@ type DownloadTaskResponse struct {
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
// Peer id. // Peer id.
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
// Task response headers. // Types that are assignable to Request:
ResponseHeader map[string]string `protobuf:"bytes,4,rep,name=response_header,json=responseHeader,proto3" json:"response_header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //
// Finished piece of task. // *DownloadTaskResponse_DownloadTaskStartedRequest
Piece *v2.Piece `protobuf:"bytes,5,opt,name=piece,proto3" json:"piece,omitempty"` // *DownloadTaskResponse_DownloadTaskFinishedRequest
// *DownloadTaskResponse_DownloadPieceFinishedRequest
Request isDownloadTaskResponse_Request `protobuf_oneof:"request"`
} }
func (x *DownloadTaskResponse) Reset() { func (x *DownloadTaskResponse) Reset() {
*x = DownloadTaskResponse{} *x = DownloadTaskResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -402,7 +541,7 @@ func (x *DownloadTaskResponse) String() string {
func (*DownloadTaskResponse) ProtoMessage() {} func (*DownloadTaskResponse) ProtoMessage() {}
func (x *DownloadTaskResponse) ProtoReflect() protoreflect.Message { func (x *DownloadTaskResponse) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -415,7 +554,7 @@ func (x *DownloadTaskResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownloadTaskResponse.ProtoReflect.Descriptor instead. // Deprecated: Use DownloadTaskResponse.ProtoReflect.Descriptor instead.
func (*DownloadTaskResponse) Descriptor() ([]byte, []int) { func (*DownloadTaskResponse) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6} return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{9}
} }
func (x *DownloadTaskResponse) GetHostId() string { func (x *DownloadTaskResponse) GetHostId() string {
@ -439,20 +578,56 @@ func (x *DownloadTaskResponse) GetPeerId() string {
return "" return ""
} }
func (x *DownloadTaskResponse) GetResponseHeader() map[string]string { func (m *DownloadTaskResponse) GetRequest() isDownloadTaskResponse_Request {
if x != nil { if m != nil {
return x.ResponseHeader return m.Request
} }
return nil return nil
} }
func (x *DownloadTaskResponse) GetPiece() *v2.Piece { func (x *DownloadTaskResponse) GetDownloadTaskStartedRequest() *DownloadTaskStartedRequest {
if x != nil { if x, ok := x.GetRequest().(*DownloadTaskResponse_DownloadTaskStartedRequest); ok {
return x.Piece return x.DownloadTaskStartedRequest
} }
return nil return nil
} }
func (x *DownloadTaskResponse) GetDownloadTaskFinishedRequest() *DownloadTaskFinishedRequest {
if x, ok := x.GetRequest().(*DownloadTaskResponse_DownloadTaskFinishedRequest); ok {
return x.DownloadTaskFinishedRequest
}
return nil
}
func (x *DownloadTaskResponse) GetDownloadPieceFinishedRequest() *DownloadPieceFinishedRequest {
if x, ok := x.GetRequest().(*DownloadTaskResponse_DownloadPieceFinishedRequest); ok {
return x.DownloadPieceFinishedRequest
}
return nil
}
type isDownloadTaskResponse_Request interface {
isDownloadTaskResponse_Request()
}
type DownloadTaskResponse_DownloadTaskStartedRequest struct {
DownloadTaskStartedRequest *DownloadTaskStartedRequest `protobuf:"bytes,4,opt,name=download_task_started_request,json=downloadTaskStartedRequest,proto3,oneof"`
}
type DownloadTaskResponse_DownloadTaskFinishedRequest struct {
DownloadTaskFinishedRequest *DownloadTaskFinishedRequest `protobuf:"bytes,5,opt,name=download_task_finished_request,json=downloadTaskFinishedRequest,proto3,oneof"`
}
type DownloadTaskResponse_DownloadPieceFinishedRequest struct {
DownloadPieceFinishedRequest *DownloadPieceFinishedRequest `protobuf:"bytes,6,opt,name=download_piece_finished_request,json=downloadPieceFinishedRequest,proto3,oneof"`
}
func (*DownloadTaskResponse_DownloadTaskStartedRequest) isDownloadTaskResponse_Request() {}
func (*DownloadTaskResponse_DownloadTaskFinishedRequest) isDownloadTaskResponse_Request() {}
func (*DownloadTaskResponse_DownloadPieceFinishedRequest) isDownloadTaskResponse_Request() {}
// UploadTaskRequest represents request of UploadTask. // UploadTaskRequest represents request of UploadTask.
type UploadTaskRequest struct { type UploadTaskRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -466,7 +641,7 @@ type UploadTaskRequest struct {
func (x *UploadTaskRequest) Reset() { func (x *UploadTaskRequest) Reset() {
*x = UploadTaskRequest{} *x = UploadTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -479,7 +654,7 @@ func (x *UploadTaskRequest) String() string {
func (*UploadTaskRequest) ProtoMessage() {} func (*UploadTaskRequest) ProtoMessage() {}
func (x *UploadTaskRequest) ProtoReflect() protoreflect.Message { func (x *UploadTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -492,7 +667,7 @@ func (x *UploadTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UploadTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use UploadTaskRequest.ProtoReflect.Descriptor instead.
func (*UploadTaskRequest) Descriptor() ([]byte, []int) { func (*UploadTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7} return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{10}
} }
func (x *UploadTaskRequest) GetTask() *v2.Task { func (x *UploadTaskRequest) GetTask() *v2.Task {
@ -515,7 +690,7 @@ type StatTaskRequest struct {
func (x *StatTaskRequest) Reset() { func (x *StatTaskRequest) Reset() {
*x = StatTaskRequest{} *x = StatTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -528,7 +703,7 @@ func (x *StatTaskRequest) String() string {
func (*StatTaskRequest) ProtoMessage() {} func (*StatTaskRequest) ProtoMessage() {}
func (x *StatTaskRequest) ProtoReflect() protoreflect.Message { func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -541,7 +716,7 @@ func (x *StatTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.
func (*StatTaskRequest) Descriptor() ([]byte, []int) { func (*StatTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{8} return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{11}
} }
func (x *StatTaskRequest) GetTaskId() string { func (x *StatTaskRequest) GetTaskId() string {
@ -564,7 +739,7 @@ type DeleteTaskRequest struct {
func (x *DeleteTaskRequest) Reset() { func (x *DeleteTaskRequest) Reset() {
*x = DeleteTaskRequest{} *x = DeleteTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -577,7 +752,7 @@ func (x *DeleteTaskRequest) String() string {
func (*DeleteTaskRequest) ProtoMessage() {} func (*DeleteTaskRequest) ProtoMessage() {}
func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message { func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -590,7 +765,7 @@ func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead.
func (*DeleteTaskRequest) Descriptor() ([]byte, []int) { func (*DeleteTaskRequest) Descriptor() ([]byte, []int) {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{9} return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{12}
} }
func (x *DeleteTaskRequest) GetTaskId() string { func (x *DeleteTaskRequest) GetTaskId() string {
@ -646,79 +821,107 @@ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc = []byte{
0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 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, 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, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x64, 0x6f, 0x77,
0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xc5, 0x01, 0x0a, 0x1a, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71,
0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x75, 0x65, 0x73, 0x74, 0x12, 0x64, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e,
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, 0x5e, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e,
0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 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, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52,
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70,
0x61, 0x64, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x05, 0x20, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x41, 0x0a, 0x13, 0x52, 0x65,
0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72,
0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x1a, 0x41, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1d, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x1c,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, 0x69, 0x6e,
0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x05,
0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x42, 0x08, 0xfa, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x08, 0xfa,
0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x22, 0x33, 0x0a, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x70, 0x69, 0x65, 0x63, 0x65, 0x22, 0xdf,
0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x03, 0x0a, 0x14, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52,
0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x07, 0x68, 0x6f, 0x73, 0x74, 0x5f,
0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10,
0x49, 0x64, 0x22, 0x35, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 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, 0x6c, 0x0a,
0x1d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x73,
0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 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, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52,
0x1a, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61,
0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6f, 0x0a, 0x1e, 0x64,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x66, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 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, 0x46, 0x69,
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52,
0x1b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e,
0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x72, 0x0a, 0x1f,
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, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18,
0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x71, 0x75, 0x65, 0x73, 0x74,
0x48, 0x00, 0x52, 0x1c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63,
0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01,
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, 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, 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, 0x91, 0x02, 0x0a, 0x0e, 0x44, 0x66, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x11, 0x44, 0x65, 0x6c,
0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x56, 0x0a, 0x13, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20,
0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x61, 0x73, 0x6b, 0x12, 0x27, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
0x32, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x32, 0x91, 0x02, 0x0a, 0x0e, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x55, 0x70, 0x6c,
0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x61, 0x64, 0x12, 0x56, 0x0a, 0x13, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x44, 0x6f,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x27, 0x2e, 0x64, 0x66, 0x64,
0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72,
0x65, 0x73, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4f, 0x0a, 0x0a, 0x53,
0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61,
0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63,
0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x66, 0x64, 0x61,
0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63,
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x64, 0x66, 0x64, 0x61, 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, 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, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x64, 0x66,
0x0a, 0x10, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f,
0x61, 0x64, 0x12, 0x55, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01,
0x73, 0x6b, 0x12, 0x20, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x12, 0x44, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e,
0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61,
0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x73, 0x6b, 0x12, 0x1c, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32,
0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6b, 0x12, 0x44, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12,
0x39, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1c, 0x2e, 0x64, 0x66, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65,
0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x44, 0x0a, 0x0a, 0x44, 0x65, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2d, 0x5a, 0x2b, 0x64, 0x37, 0x79, 0x2e, 0x69,
0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69,
0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x73, 0x73, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x3b, 0x64, 0x66,
0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -733,50 +936,56 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP() []byte {
return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescData return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescData
} }
var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_goTypes = []interface{}{ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_goTypes = []interface{}{
(*TriggerDownloadTaskRequest)(nil), // 0: dfdaemon.v2.TriggerDownloadTaskRequest (*TriggerDownloadTaskRequest)(nil), // 0: dfdaemon.v2.TriggerDownloadTaskRequest
(*SyncPiecesRequest)(nil), // 1: dfdaemon.v2.SyncPiecesRequest (*SyncPiecesRequest)(nil), // 1: dfdaemon.v2.SyncPiecesRequest
(*SyncPiecesResponse)(nil), // 2: dfdaemon.v2.SyncPiecesResponse (*SyncPiecesResponse)(nil), // 2: dfdaemon.v2.SyncPiecesResponse
(*DownloadPieceRequest)(nil), // 3: dfdaemon.v2.DownloadPieceRequest (*DownloadPieceRequest)(nil), // 3: dfdaemon.v2.DownloadPieceRequest
(*DownloadPieceResponse)(nil), // 4: dfdaemon.v2.DownloadPieceResponse (*DownloadPieceResponse)(nil), // 4: dfdaemon.v2.DownloadPieceResponse
(*DownloadTaskRequest)(nil), // 5: dfdaemon.v2.DownloadTaskRequest (*DownloadTaskRequest)(nil), // 5: dfdaemon.v2.DownloadTaskRequest
(*DownloadTaskResponse)(nil), // 6: dfdaemon.v2.DownloadTaskResponse (*DownloadTaskStartedRequest)(nil), // 6: dfdaemon.v2.DownloadTaskStartedRequest
(*UploadTaskRequest)(nil), // 7: dfdaemon.v2.UploadTaskRequest (*DownloadTaskFinishedRequest)(nil), // 7: dfdaemon.v2.DownloadTaskFinishedRequest
(*StatTaskRequest)(nil), // 8: dfdaemon.v2.StatTaskRequest (*DownloadPieceFinishedRequest)(nil), // 8: dfdaemon.v2.DownloadPieceFinishedRequest
(*DeleteTaskRequest)(nil), // 9: dfdaemon.v2.DeleteTaskRequest (*DownloadTaskResponse)(nil), // 9: dfdaemon.v2.DownloadTaskResponse
nil, // 10: dfdaemon.v2.DownloadTaskResponse.ResponseHeaderEntry (*UploadTaskRequest)(nil), // 10: dfdaemon.v2.UploadTaskRequest
(*v2.Download)(nil), // 11: common.v2.Download (*StatTaskRequest)(nil), // 11: dfdaemon.v2.StatTaskRequest
(*v2.Piece)(nil), // 12: common.v2.Piece (*DeleteTaskRequest)(nil), // 12: dfdaemon.v2.DeleteTaskRequest
(*v2.Task)(nil), // 13: common.v2.Task nil, // 13: dfdaemon.v2.DownloadTaskStartedRequest.ResponseHeaderEntry
(*emptypb.Empty)(nil), // 14: google.protobuf.Empty (*v2.Download)(nil), // 14: common.v2.Download
(*v2.Piece)(nil), // 15: common.v2.Piece
(*v2.Task)(nil), // 16: common.v2.Task
(*emptypb.Empty)(nil), // 17: google.protobuf.Empty
} }
var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_depIdxs = []int32{ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_depIdxs = []int32{
11, // 0: dfdaemon.v2.TriggerDownloadTaskRequest.download:type_name -> common.v2.Download 14, // 0: dfdaemon.v2.TriggerDownloadTaskRequest.download:type_name -> common.v2.Download
12, // 1: dfdaemon.v2.DownloadPieceResponse.piece:type_name -> common.v2.Piece 15, // 1: dfdaemon.v2.DownloadPieceResponse.piece:type_name -> common.v2.Piece
11, // 2: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download 14, // 2: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download
10, // 3: dfdaemon.v2.DownloadTaskResponse.response_header:type_name -> dfdaemon.v2.DownloadTaskResponse.ResponseHeaderEntry 13, // 3: dfdaemon.v2.DownloadTaskStartedRequest.response_header:type_name -> dfdaemon.v2.DownloadTaskStartedRequest.ResponseHeaderEntry
12, // 4: dfdaemon.v2.DownloadTaskResponse.piece:type_name -> common.v2.Piece 15, // 4: dfdaemon.v2.DownloadPieceFinishedRequest.piece:type_name -> common.v2.Piece
13, // 5: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task 6, // 5: dfdaemon.v2.DownloadTaskResponse.download_task_started_request:type_name -> dfdaemon.v2.DownloadTaskStartedRequest
0, // 6: dfdaemon.v2.DfdaemonUpload.TriggerDownloadTask:input_type -> dfdaemon.v2.TriggerDownloadTaskRequest 7, // 6: dfdaemon.v2.DownloadTaskResponse.download_task_finished_request:type_name -> dfdaemon.v2.DownloadTaskFinishedRequest
1, // 7: dfdaemon.v2.DfdaemonUpload.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest 8, // 7: dfdaemon.v2.DownloadTaskResponse.download_piece_finished_request:type_name -> dfdaemon.v2.DownloadPieceFinishedRequest
3, // 8: dfdaemon.v2.DfdaemonUpload.DownloadPiece:input_type -> dfdaemon.v2.DownloadPieceRequest 16, // 8: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task
5, // 9: dfdaemon.v2.DfdaemonDownload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest 0, // 9: dfdaemon.v2.DfdaemonUpload.TriggerDownloadTask:input_type -> dfdaemon.v2.TriggerDownloadTaskRequest
7, // 10: dfdaemon.v2.DfdaemonDownload.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest 1, // 10: dfdaemon.v2.DfdaemonUpload.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest
8, // 11: dfdaemon.v2.DfdaemonDownload.StatTask:input_type -> dfdaemon.v2.StatTaskRequest 3, // 11: dfdaemon.v2.DfdaemonUpload.DownloadPiece:input_type -> dfdaemon.v2.DownloadPieceRequest
9, // 12: dfdaemon.v2.DfdaemonDownload.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest 5, // 12: dfdaemon.v2.DfdaemonDownload.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest
14, // 13: dfdaemon.v2.DfdaemonUpload.TriggerDownloadTask:output_type -> google.protobuf.Empty 10, // 13: dfdaemon.v2.DfdaemonDownload.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest
2, // 14: dfdaemon.v2.DfdaemonUpload.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse 11, // 14: dfdaemon.v2.DfdaemonDownload.StatTask:input_type -> dfdaemon.v2.StatTaskRequest
4, // 15: dfdaemon.v2.DfdaemonUpload.DownloadPiece:output_type -> dfdaemon.v2.DownloadPieceResponse 12, // 15: dfdaemon.v2.DfdaemonDownload.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest
6, // 16: dfdaemon.v2.DfdaemonDownload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse 17, // 16: dfdaemon.v2.DfdaemonUpload.TriggerDownloadTask:output_type -> google.protobuf.Empty
14, // 17: dfdaemon.v2.DfdaemonDownload.UploadTask:output_type -> google.protobuf.Empty 2, // 17: dfdaemon.v2.DfdaemonUpload.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse
13, // 18: dfdaemon.v2.DfdaemonDownload.StatTask:output_type -> common.v2.Task 4, // 18: dfdaemon.v2.DfdaemonUpload.DownloadPiece:output_type -> dfdaemon.v2.DownloadPieceResponse
14, // 19: dfdaemon.v2.DfdaemonDownload.DeleteTask:output_type -> google.protobuf.Empty 9, // 19: dfdaemon.v2.DfdaemonDownload.DownloadTask:output_type -> dfdaemon.v2.DownloadTaskResponse
13, // [13:20] is the sub-list for method output_type 17, // 20: dfdaemon.v2.DfdaemonDownload.UploadTask:output_type -> google.protobuf.Empty
6, // [6:13] is the sub-list for method input_type 16, // 21: dfdaemon.v2.DfdaemonDownload.StatTask:output_type -> common.v2.Task
6, // [6:6] is the sub-list for extension type_name 17, // 22: dfdaemon.v2.DfdaemonDownload.DeleteTask:output_type -> google.protobuf.Empty
6, // [6:6] is the sub-list for extension extendee 16, // [16:23] is the sub-list for method output_type
0, // [0:6] is the sub-list for field type_name 9, // [9:16] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
} }
func init() { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() } func init() { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() }
@ -858,7 +1067,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{} { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloadTaskResponse); i { switch v := v.(*DownloadTaskStartedRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -870,7 +1079,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{} { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UploadTaskRequest); i { switch v := v.(*DownloadTaskFinishedRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -882,7 +1091,7 @@ 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{} { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatTaskRequest); i { switch v := v.(*DownloadPieceFinishedRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -894,6 +1103,42 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() {
} }
} }
file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownloadTaskResponse); 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.(*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[11].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[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteTaskRequest); i { switch v := v.(*DeleteTaskRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -906,13 +1151,18 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() {
} }
} }
} }
file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].OneofWrappers = []interface{}{
(*DownloadTaskResponse_DownloadTaskStartedRequest)(nil),
(*DownloadTaskResponse_DownloadTaskFinishedRequest)(nil),
(*DownloadTaskResponse_DownloadPieceFinishedRequest)(nil),
}
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc, RawDescriptor: file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 11, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 2, NumServices: 2,
}, },

View File

@ -808,6 +808,356 @@ var _ interface {
ErrorName() string ErrorName() string
} = DownloadTaskRequestValidationError{} } = DownloadTaskRequestValidationError{}
// Validate checks the field values on DownloadTaskStartedRequest 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 *DownloadTaskStartedRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadTaskStartedRequest 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
// DownloadTaskStartedRequestMultiError, or nil if none found.
func (m *DownloadTaskStartedRequest) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadTaskStartedRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for ResponseHeader
if len(errors) > 0 {
return DownloadTaskStartedRequestMultiError(errors)
}
return nil
}
// DownloadTaskStartedRequestMultiError is an error wrapping multiple
// validation errors returned by DownloadTaskStartedRequest.ValidateAll() if
// the designated constraints aren't met.
type DownloadTaskStartedRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadTaskStartedRequestMultiError) 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 DownloadTaskStartedRequestMultiError) AllErrors() []error { return m }
// DownloadTaskStartedRequestValidationError is the validation error returned
// by DownloadTaskStartedRequest.Validate if the designated constraints aren't met.
type DownloadTaskStartedRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadTaskStartedRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadTaskStartedRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadTaskStartedRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadTaskStartedRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadTaskStartedRequestValidationError) ErrorName() string {
return "DownloadTaskStartedRequestValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadTaskStartedRequestValidationError) 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 %sDownloadTaskStartedRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadTaskStartedRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadTaskStartedRequestValidationError{}
// Validate checks the field values on DownloadTaskFinishedRequest 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 *DownloadTaskFinishedRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadTaskFinishedRequest 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
// DownloadTaskFinishedRequestMultiError, or nil if none found.
func (m *DownloadTaskFinishedRequest) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadTaskFinishedRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if len(errors) > 0 {
return DownloadTaskFinishedRequestMultiError(errors)
}
return nil
}
// DownloadTaskFinishedRequestMultiError is an error wrapping multiple
// validation errors returned by DownloadTaskFinishedRequest.ValidateAll() if
// the designated constraints aren't met.
type DownloadTaskFinishedRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadTaskFinishedRequestMultiError) 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 DownloadTaskFinishedRequestMultiError) AllErrors() []error { return m }
// DownloadTaskFinishedRequestValidationError is the validation error returned
// by DownloadTaskFinishedRequest.Validate if the designated constraints
// aren't met.
type DownloadTaskFinishedRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadTaskFinishedRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadTaskFinishedRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadTaskFinishedRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadTaskFinishedRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadTaskFinishedRequestValidationError) ErrorName() string {
return "DownloadTaskFinishedRequestValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadTaskFinishedRequestValidationError) 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 %sDownloadTaskFinishedRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadTaskFinishedRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadTaskFinishedRequestValidationError{}
// Validate checks the field values on DownloadPieceFinishedRequest 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 *DownloadPieceFinishedRequest) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on DownloadPieceFinishedRequest 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
// DownloadPieceFinishedRequestMultiError, or nil if none found.
func (m *DownloadPieceFinishedRequest) ValidateAll() error {
return m.validate(true)
}
func (m *DownloadPieceFinishedRequest) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
if m.GetPiece() == nil {
err := DownloadPieceFinishedRequestValidationError{
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, DownloadPieceFinishedRequestValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadPieceFinishedRequestValidationError{
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 DownloadPieceFinishedRequestValidationError{
field: "Piece",
reason: "embedded message failed validation",
cause: err,
}
}
}
if len(errors) > 0 {
return DownloadPieceFinishedRequestMultiError(errors)
}
return nil
}
// DownloadPieceFinishedRequestMultiError is an error wrapping multiple
// validation errors returned by DownloadPieceFinishedRequest.ValidateAll() if
// the designated constraints aren't met.
type DownloadPieceFinishedRequestMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m DownloadPieceFinishedRequestMultiError) 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 DownloadPieceFinishedRequestMultiError) AllErrors() []error { return m }
// DownloadPieceFinishedRequestValidationError is the validation error returned
// by DownloadPieceFinishedRequest.Validate if the designated constraints
// aren't met.
type DownloadPieceFinishedRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownloadPieceFinishedRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownloadPieceFinishedRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownloadPieceFinishedRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownloadPieceFinishedRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownloadPieceFinishedRequestValidationError) ErrorName() string {
return "DownloadPieceFinishedRequestValidationError"
}
// Error satisfies the builtin error interface
func (e DownloadPieceFinishedRequestValidationError) 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 %sDownloadPieceFinishedRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownloadPieceFinishedRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownloadPieceFinishedRequestValidationError{}
// Validate checks the field values on DownloadTaskResponse with the rules // Validate checks the field values on DownloadTaskResponse with the rules
// defined in the proto definition for this message. If any rules are // 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. // violated, the first error encountered is returned, or nil if there are no violations.
@ -863,11 +1213,140 @@ func (m *DownloadTaskResponse) validate(all bool) error {
errors = append(errors, err) errors = append(errors, err)
} }
// no validation rules for ResponseHeader oneofRequestPresent := false
switch v := m.Request.(type) {
case *DownloadTaskResponse_DownloadTaskStartedRequest:
if v == nil {
err := DownloadTaskResponseValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if m.GetPiece() == nil { if all {
switch v := interface{}(m.GetDownloadTaskStartedRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskStartedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskStartedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDownloadTaskStartedRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "DownloadTaskStartedRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *DownloadTaskResponse_DownloadTaskFinishedRequest:
if v == nil {
err := DownloadTaskResponseValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetDownloadTaskFinishedRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskFinishedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadTaskFinishedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDownloadTaskFinishedRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "DownloadTaskFinishedRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *DownloadTaskResponse_DownloadPieceFinishedRequest:
if v == nil {
err := DownloadTaskResponseValidationError{
field: "Request",
reason: "oneof value cannot be a typed-nil",
}
if !all {
return err
}
errors = append(errors, err)
}
oneofRequestPresent = true
if all {
switch v := interface{}(m.GetDownloadPieceFinishedRequest()).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedRequest",
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(m.GetDownloadPieceFinishedRequest()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownloadTaskResponseValidationError{
field: "DownloadPieceFinishedRequest",
reason: "embedded message failed validation",
cause: err,
}
}
}
default:
_ = v // ensures v is used
}
if !oneofRequestPresent {
err := DownloadTaskResponseValidationError{ err := DownloadTaskResponseValidationError{
field: "Piece", field: "Request",
reason: "value is required", reason: "value is required",
} }
if !all { if !all {
@ -876,35 +1355,6 @@ func (m *DownloadTaskResponse) validate(all bool) error {
errors = append(errors, 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, 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 { if len(errors) > 0 {
return DownloadTaskResponseMultiError(errors) return DownloadTaskResponseMultiError(errors)
} }

View File

@ -80,6 +80,22 @@ message DownloadTaskRequest {
common.v2.Download download = 1 [(validate.rules).message.required = true]; common.v2.Download download = 1 [(validate.rules).message.required = true];
} }
// DownloadTaskStartedRequest represents task download started request of DownloadTaskResponse.
message DownloadTaskStartedRequest {
// Task response headers.
map<string, string> response_header = 1;
}
// DownloadTaskFinishedRequest represents task download finished request of DownloadTaskResponse.
message DownloadTaskFinishedRequest {
}
// DownloadPieceFinishedRequest represents piece download finished request of DownloadTaskResponse.
message DownloadPieceFinishedRequest {
// Finished piece of task.
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
}
// DownloadTaskResponse represents response of DownloadTask. // DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse { message DownloadTaskResponse {
// Host id. // Host id.
@ -88,10 +104,14 @@ message DownloadTaskResponse {
string task_id = 2 [(validate.rules).string.min_len = 1]; string task_id = 2 [(validate.rules).string.min_len = 1];
// Peer id. // Peer id.
string peer_id = 3 [(validate.rules).string.min_len = 1]; string peer_id = 3 [(validate.rules).string.min_len = 1];
// Task response headers.
map<string, string> response_header = 4; oneof request {
// Finished piece of task. option (validate.required) = true;
common.v2.Piece piece = 5 [(validate.rules).message.required = true];
DownloadTaskStartedRequest download_task_started_request = 4;
DownloadTaskFinishedRequest download_task_finished_request = 5;
DownloadPieceFinishedRequest download_piece_finished_request = 6;
}
} }
// UploadTaskRequest represents request of UploadTask. // UploadTaskRequest represents request of UploadTask.

View File

@ -77,6 +77,22 @@ message DownloadTaskRequest {
common.v2.Download download = 1; common.v2.Download download = 1;
} }
// DownloadTaskStartedRequest represents task download started request of DownloadTaskResponse.
message DownloadTaskStartedRequest {
// Task response headers.
map<string, string> response_header = 1;
}
// DownloadTaskFinishedRequest represents task download finished request of DownloadTaskResponse.
message DownloadTaskFinishedRequest {
}
// DownloadPieceFinishedRequest represents piece download finished request of DownloadTaskResponse.
message DownloadPieceFinishedRequest {
// Finished piece of task.
common.v2.Piece piece = 1;
}
// DownloadTaskResponse represents response of DownloadTask. // DownloadTaskResponse represents response of DownloadTask.
message DownloadTaskResponse { message DownloadTaskResponse {
// Host id. // Host id.
@ -85,10 +101,12 @@ message DownloadTaskResponse {
string task_id = 2; string task_id = 2;
// Peer id. // Peer id.
string peer_id = 3; string peer_id = 3;
// Task response headers.
map<string, string> response_header = 4; oneof request {
// Finished piece of task. DownloadTaskStartedRequest download_task_started_request = 4;
common.v2.Piece piece = 5; DownloadTaskFinishedRequest download_task_finished_request = 5;
DownloadPieceFinishedRequest download_piece_finished_request = 6;
}
} }
// UploadTaskRequest represents request of UploadTask. // UploadTaskRequest represents request of UploadTask.

Binary file not shown.

View File

@ -64,6 +64,32 @@ pub struct DownloadTaskRequest {
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::super::common::v2::Download>, pub download: ::core::option::Option<super::super::common::v2::Download>,
} }
/// DownloadTaskStartedRequest represents task download started request of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskStartedRequest {
/// Task response headers.
#[prost(map = "string, string", tag = "1")]
pub response_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
/// DownloadTaskFinishedRequest represents task download finished request of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskFinishedRequest {}
/// DownloadPieceFinishedRequest represents piece download finished request of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceFinishedRequest {
/// Finished piece of task.
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
/// DownloadTaskResponse represents response of DownloadTask. /// DownloadTaskResponse represents response of DownloadTask.
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
@ -78,15 +104,22 @@ pub struct DownloadTaskResponse {
/// Peer id. /// Peer id.
#[prost(string, tag = "3")] #[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String, pub peer_id: ::prost::alloc::string::String,
/// Task response headers. #[prost(oneof = "download_task_response::Request", tags = "4, 5, 6")]
#[prost(map = "string, string", tag = "4")] pub request: ::core::option::Option<download_task_response::Request>,
pub response_header: ::std::collections::HashMap< }
::prost::alloc::string::String, /// Nested message and enum types in `DownloadTaskResponse`.
::prost::alloc::string::String, pub mod download_task_response {
>, #[derive(serde::Serialize, serde::Deserialize)]
/// Finished piece of task. #[allow(clippy::derive_partial_eq_without_eq)]
#[prost(message, optional, tag = "5")] #[derive(Clone, PartialEq, ::prost::Oneof)]
pub piece: ::core::option::Option<super::super::common::v2::Piece>, pub enum Request {
#[prost(message, tag = "4")]
DownloadTaskStartedRequest(super::DownloadTaskStartedRequest),
#[prost(message, tag = "5")]
DownloadTaskFinishedRequest(super::DownloadTaskFinishedRequest),
#[prost(message, tag = "6")]
DownloadPieceFinishedRequest(super::DownloadPieceFinishedRequest),
}
} }
/// UploadTaskRequest represents request of UploadTask. /// UploadTaskRequest represents request of UploadTask.
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]