diff --git a/pkg/apis/common/v2/common.pb.go b/pkg/apis/common/v2/common.pb.go index 41ee6a8..fff2ea4 100644 --- a/pkg/apis/common/v2/common.pb.go +++ b/pkg/apis/common/v2/common.pb.go @@ -294,18 +294,26 @@ type Peer struct { // Peer id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Range is url range of request. + Range *Range `protobuf:"bytes,2,opt,name=range,proto3" json:"range,omitempty"` + // Peer priority. + Priority Priority `protobuf:"varint,3,opt,name=priority,proto3,enum=common.v2.Priority" json:"priority,omitempty"` // Pieces of peer. - Pieces []*Piece `protobuf:"bytes,2,rep,name=pieces,proto3" json:"pieces,omitempty"` - // Task info. - Task *Task `protobuf:"bytes,3,opt,name=task,proto3" json:"task,omitempty"` - // Host info. - Host *Host `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` + Pieces []*Piece `protobuf:"bytes,4,rep,name=pieces,proto3" json:"pieces,omitempty"` + // Peer downloads costs time. + Cost *durationpb.Duration `protobuf:"bytes,5,opt,name=cost,proto3" json:"cost,omitempty"` // Peer state. - State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` + State string `protobuf:"bytes,6,opt,name=state,proto3" json:"state,omitempty"` + // Task info. + Task *Task `protobuf:"bytes,7,opt,name=task,proto3" json:"task,omitempty"` + // Host info. + Host *Host `protobuf:"bytes,8,opt,name=host,proto3" json:"host,omitempty"` + // NeedBackToSource needs downloaded from source. + NeedBackToSource bool `protobuf:"varint,9,opt,name=need_back_to_source,json=needBackToSource,proto3" json:"need_back_to_source,omitempty"` // Peer create time. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Peer update time. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } func (x *Peer) Reset() { @@ -347,6 +355,20 @@ func (x *Peer) GetId() string { return "" } +func (x *Peer) GetRange() *Range { + if x != nil { + return x.Range + } + return nil +} + +func (x *Peer) GetPriority() Priority { + if x != nil { + return x.Priority + } + return Priority_LEVEL0 +} + func (x *Peer) GetPieces() []*Piece { if x != nil { return x.Pieces @@ -354,6 +376,20 @@ func (x *Peer) GetPieces() []*Piece { return nil } +func (x *Peer) GetCost() *durationpb.Duration { + if x != nil { + return x.Cost + } + return nil +} + +func (x *Peer) GetState() string { + if x != nil { + return x.State + } + return "" +} + func (x *Peer) GetTask() *Task { if x != nil { return x.Task @@ -368,11 +404,11 @@ func (x *Peer) GetHost() *Host { return nil } -func (x *Peer) GetState() string { +func (x *Peer) GetNeedBackToSource() bool { if x != nil { - return x.State + return x.NeedBackToSource } - return "" + return false } func (x *Peer) GetCreatedAt() *timestamppb.Timestamp { @@ -397,26 +433,40 @@ type Task struct { // Task id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Host type. + // Task type. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - // Task size scope. - SizeScope SizeScope `protobuf:"varint,3,opt,name=size_scope,json=sizeScope,proto3,enum=common.v2.SizeScope" json:"size_scope,omitempty"` - // Pieces of task. - Pieces []*Piece `protobuf:"bytes,4,rep,name=pieces,proto3" json:"pieces,omitempty"` - // Task state. - State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` - // Task metadata. - Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Download url. + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + // Digest of the pieces digest, for example md5:xxx or sha256:yyy. + Digest string `protobuf:"bytes,4,opt,name=digest,proto3" json:"digest,omitempty"` + // URL tag identifies different task for same url. + Tag string `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"` + // Application of task. + Application string `protobuf:"bytes,6,opt,name=application,proto3" json:"application,omitempty"` + // Filter url used to generate task id. + Filters []string `protobuf:"bytes,7,rep,name=filters,proto3" json:"filters,omitempty"` + // Task request headers. + Header map[string]string `protobuf:"bytes,8,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Task piece size. + PieceSize int32 `protobuf:"varint,9,opt,name=piece_size,json=pieceSize,proto3" json:"piece_size,omitempty"` // Task content length. - ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"` + ContentLength int64 `protobuf:"varint,10,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"` + // Task piece count. + PieceCount int64 `protobuf:"varint,11,opt,name=piece_count,json=pieceCount,proto3" json:"piece_count,omitempty"` + // Task size scope. + SizeScope SizeScope `protobuf:"varint,12,opt,name=size_scope,json=sizeScope,proto3,enum=common.v2.SizeScope" json:"size_scope,omitempty"` + // Pieces of task. + Pieces []*Piece `protobuf:"bytes,13,rep,name=pieces,proto3" json:"pieces,omitempty"` + // Task state. + State string `protobuf:"bytes,14,opt,name=state,proto3" json:"state,omitempty"` // Task peer count. - PeerCount int32 `protobuf:"varint,8,opt,name=peer_count,json=peerCount,proto3" json:"peer_count,omitempty"` + PeerCount int32 `protobuf:"varint,15,opt,name=peer_count,json=peerCount,proto3" json:"peer_count,omitempty"` // Task contains available peer. - HasAvailablePeer bool `protobuf:"varint,9,opt,name=hasAvailablePeer,proto3" json:"hasAvailablePeer,omitempty"` + HasAvailablePeer bool `protobuf:"varint,16,opt,name=hasAvailablePeer,proto3" json:"hasAvailablePeer,omitempty"` // Task create time. - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Task update time. - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } func (x *Task) Reset() { @@ -465,6 +515,69 @@ func (x *Task) GetType() string { return "" } +func (x *Task) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Task) GetDigest() string { + if x != nil { + return x.Digest + } + return "" +} + +func (x *Task) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +func (x *Task) GetApplication() string { + if x != nil { + return x.Application + } + return "" +} + +func (x *Task) GetFilters() []string { + if x != nil { + return x.Filters + } + return nil +} + +func (x *Task) GetHeader() map[string]string { + if x != nil { + return x.Header + } + return nil +} + +func (x *Task) GetPieceSize() int32 { + if x != nil { + return x.PieceSize + } + return 0 +} + +func (x *Task) GetContentLength() int64 { + if x != nil { + return x.ContentLength + } + return 0 +} + +func (x *Task) GetPieceCount() int64 { + if x != nil { + return x.PieceCount + } + return 0 +} + func (x *Task) GetSizeScope() SizeScope { if x != nil { return x.SizeScope @@ -486,20 +599,6 @@ func (x *Task) GetState() string { return "" } -func (x *Task) GetMetadata() *Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *Task) GetContentLength() int64 { - if x != nil { - return x.ContentLength - } - return 0 -} - func (x *Task) GetPeerCount() int32 { if x != nil { return x.PeerCount @@ -698,8 +797,8 @@ func (x *Range) GetEnd() uint64 { return 0 } -// Metadata represents metadata of task. -type Metadata struct { +// Download information. +type Download struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -724,10 +823,18 @@ type Metadata struct { Header map[string]string `protobuf:"bytes,9,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Task piece size. PieceSize int32 `protobuf:"varint,10,opt,name=piece_size,json=pieceSize,proto3" json:"piece_size,omitempty"` + // File path to be exported. + OutputPath string `protobuf:"bytes,11,opt,name=output_path,json=outputPath,proto3" json:"output_path,omitempty"` + // Download timeout. + Timeout *durationpb.Duration `protobuf:"bytes,12,opt,name=timeout,proto3" json:"timeout,omitempty"` + // Download rate limit in bytes per second. + DownloadRateLimit float64 `protobuf:"fixed64,13,opt,name=download_rate_limit,json=downloadRateLimit,proto3" json:"download_rate_limit,omitempty"` + // NeedBackToSource needs downloaded from source. + NeedBackToSource bool `protobuf:"varint,14,opt,name=need_back_to_source,json=needBackToSource,proto3" json:"need_back_to_source,omitempty"` } -func (x *Metadata) Reset() { - *x = Metadata{} +func (x *Download) Reset() { + *x = Download{} if protoimpl.UnsafeEnabled { mi := &file_pkg_apis_common_v2_common_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -735,13 +842,13 @@ func (x *Metadata) Reset() { } } -func (x *Metadata) String() string { +func (x *Download) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Metadata) ProtoMessage() {} +func (*Download) ProtoMessage() {} -func (x *Metadata) ProtoReflect() protoreflect.Message { +func (x *Download) ProtoReflect() protoreflect.Message { mi := &file_pkg_apis_common_v2_common_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -753,81 +860,109 @@ func (x *Metadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. -func (*Metadata) Descriptor() ([]byte, []int) { +// Deprecated: Use Download.ProtoReflect.Descriptor instead. +func (*Download) Descriptor() ([]byte, []int) { return file_pkg_apis_common_v2_common_proto_rawDescGZIP(), []int{4} } -func (x *Metadata) GetUrl() string { +func (x *Download) GetUrl() string { if x != nil { return x.Url } return "" } -func (x *Metadata) GetDigest() string { +func (x *Download) GetDigest() string { if x != nil { return x.Digest } return "" } -func (x *Metadata) GetRange() *Range { +func (x *Download) GetRange() *Range { if x != nil { return x.Range } return nil } -func (x *Metadata) GetType() TaskType { +func (x *Download) GetType() TaskType { if x != nil { return x.Type } return TaskType_DFDAEMON } -func (x *Metadata) GetTag() string { +func (x *Download) GetTag() string { if x != nil { return x.Tag } return "" } -func (x *Metadata) GetApplication() string { +func (x *Download) GetApplication() string { if x != nil { return x.Application } return "" } -func (x *Metadata) GetPriority() Priority { +func (x *Download) GetPriority() Priority { if x != nil { return x.Priority } return Priority_LEVEL0 } -func (x *Metadata) GetFilters() []string { +func (x *Download) GetFilters() []string { if x != nil { return x.Filters } return nil } -func (x *Metadata) GetHeader() map[string]string { +func (x *Download) GetHeader() map[string]string { if x != nil { return x.Header } return nil } -func (x *Metadata) GetPieceSize() int32 { +func (x *Download) GetPieceSize() int32 { if x != nil { return x.PieceSize } return 0 } +func (x *Download) GetOutputPath() string { + if x != nil { + return x.OutputPath + } + return "" +} + +func (x *Download) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *Download) GetDownloadRateLimit() float64 { + if x != nil { + return x.DownloadRateLimit + } + return 0 +} + +func (x *Download) GetNeedBackToSource() bool { + if x != nil { + return x.NeedBackToSource + } + return false +} + // Piece represents information of piece. type Piece struct { state protoimpl.MessageState @@ -1018,175 +1153,220 @@ var file_pkg_apis_common_v2_common_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x02, 0x0a, 0x04, 0x50, 0x65, 0x65, 0x72, 0x12, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x04, 0x0a, 0x04, 0x50, 0x65, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, - 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x2d, - 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, 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, 0x12, 0x2d, 0x0a, - 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x39, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x70, + 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, + 0x73, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, + 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x61, 0x73, + 0x6b, 0x18, 0x07, 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, 0x12, 0x2d, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x32, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, + 0x01, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6e, 0x65, 0x65, 0x64, 0x5f, + 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6e, 0x65, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x43, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x43, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xaa, 0x04, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x17, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x22, 0xfa, 0x42, 0x1f, 0x72, 0x1d, 0x52, 0x06, 0x6e, 0x6f, - 0x72, 0x6d, 0x61, 0x6c, 0x52, 0x05, 0x73, 0x75, 0x70, 0x65, 0x72, 0x52, 0x06, 0x73, 0x74, 0x72, - 0x6f, 0x6e, 0x67, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x33, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, - 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x53, - 0x63, 0x6f, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, - 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, - 0x28, 0x01, 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, - 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x22, 0x02, 0x28, 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, - 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, - 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, - 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, - 0x08, 0x01, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x43, 0x0a, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, - 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x22, 0xad, 0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x23, 0x0a, - 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x31, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, - 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, - 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x33, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x08, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, - 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, - 0x64, 0x63, 0x22, 0x2f, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x65, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, - 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, - 0x65, 0x6e, 0x64, 0x22, 0xe7, 0x03, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, - 0x42, 0x05, 0x72, 0x03, 0x88, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x06, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, - 0x24, 0x72, 0x22, 0x32, 0x1d, 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, 0x73, 0x68, 0x61, - 0x32, 0x35, 0x36, 0x29, 0x3a, 0x5b, 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, 0x2d, 0x39, 0x5d, - 0x2b, 0x24, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, - 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, - 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, - 0x10, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, - 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, - 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x12, 0x37, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, + 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x22, 0xdc, 0x06, 0x0a, 0x04, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x22, 0xfa, 0x42, 0x1f, 0x72, 0x1d, 0x52, 0x06, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x52, + 0x05, 0x73, 0x75, 0x70, 0x65, 0x72, 0x52, 0x06, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x52, 0x04, + 0x77, 0x65, 0x61, 0x6b, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x75, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0x88, 0x01, + 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x32, 0x1d, 0x5e, + 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x29, 0x3a, 0x5b, + 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xd0, 0x01, 0x01, 0x52, + 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x69, - 0x65, 0x63, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, + 0x65, 0x63, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x89, 0x03, - 0x0a, 0x05, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, - 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, - 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, - 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, - 0x3f, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x32, 0x1d, 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, - 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x29, 0x3a, 0x5b, 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, - 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x39, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x76, 0x32, 0x2e, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, - 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x63, - 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, - 0x63, 0x6f, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xda, 0x01, 0x0a, 0x0f, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x3e, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, 0x05, 0x10, 0xd7, 0x04, 0x28, 0x64, 0x52, 0x0a, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x37, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, - 0x4e, 0x59, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x03, 0x2a, - 0x32, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, - 0x46, 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x46, 0x43, - 0x41, 0x43, 0x48, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x46, 0x53, 0x54, 0x4f, 0x52, - 0x45, 0x10, 0x02, 0x2a, 0x42, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x41, 0x43, 0x4b, 0x5f, 0x54, 0x4f, 0x5f, 0x53, 0x4f, - 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, - 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x4f, 0x43, 0x41, 0x4c, - 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x02, 0x2a, 0x5e, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, - 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, - 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, - 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x35, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x36, 0x10, 0x06, 0x42, 0x26, 0x5a, 0x24, 0x64, 0x37, 0x79, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x7a, 0x65, 0x12, 0x2e, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x02, 0x28, 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x28, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x28, 0x00, + 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0a, + 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x7a, + 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, + 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, + 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, + 0x02, 0x28, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, + 0x0a, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, + 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x68, 0x61, 0x73, 0x41, 0x76, 0x61, + 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xb2, + 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x43, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xad, 0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x70, 0x12, 0x23, 0x0a, 0x08, 0x68, 0x6f, + 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x68, 0x01, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, + 0x42, 0x09, 0x1a, 0x07, 0x10, 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x31, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x1a, 0x07, 0x10, + 0xff, 0xff, 0x03, 0x28, 0x80, 0x08, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x6f, 0x72, 0x74, 0x12, 0x33, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x26, 0x0a, 0x08, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, + 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1c, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, + 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x03, 0x69, 0x64, 0x63, 0x22, + 0x2f, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x65, 0x6e, 0x64, + 0x22, 0xc2, 0x05, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, + 0x03, 0x88, 0x01, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, + 0x32, 0x1d, 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, + 0x29, 0x3a, 0x5b, 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xd0, + 0x01, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x05, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, + 0x6b, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x70, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x37, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, + 0x6f, 0x61, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x1a, 0x02, 0x28, 0x01, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x2b, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, + 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x3d, 0x0a, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, + 0x08, 0x01, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x13, 0x64, + 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6e, + 0x65, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6e, 0x65, 0x65, 0x64, 0x42, 0x61, + 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x89, 0x03, 0x0a, 0x05, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, + 0x1f, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x27, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0xd0, 0x01, 0x01, 0x52, + 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, + 0x28, 0x00, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, + 0x00, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xfa, 0x42, 0x24, 0x72, 0x22, 0x32, 0x1d, + 0x5e, 0x28, 0x6d, 0x64, 0x35, 0x29, 0x7c, 0x28, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x29, 0x3a, + 0x5b, 0x41, 0x2d, 0x46, 0x61, 0x2d, 0x66, 0x30, 0x2d, 0x39, 0x5d, 0x2b, 0x24, 0xd0, 0x01, 0x01, + 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x66, + 0x66, 0x69, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x72, 0x61, 0x66, 0x66, + 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x22, 0xda, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x1a, + 0x05, 0x10, 0xd7, 0x04, 0x28, 0x64, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x37, + 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, + 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, + 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, + 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x03, 0x2a, 0x32, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x46, 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x46, 0x43, 0x41, 0x43, 0x48, 0x45, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x44, 0x46, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x10, 0x02, 0x2a, 0x42, 0x0a, 0x0b, 0x54, + 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x42, 0x41, + 0x43, 0x4b, 0x5f, 0x54, 0x4f, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0f, + 0x0a, 0x0b, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x50, 0x45, 0x45, 0x52, 0x10, 0x02, 0x2a, + 0x5e, 0x0a, 0x08, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x4c, + 0x45, 0x56, 0x45, 0x4c, 0x30, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, + 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x32, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x33, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4c, + 0x45, 0x56, 0x45, 0x4c, 0x34, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, + 0x35, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x36, 0x10, 0x06, 0x42, + 0x26, 0x5a, 0x24, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x32, + 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1202,7 +1382,7 @@ func file_pkg_apis_common_v2_common_proto_rawDescGZIP() []byte { } var file_pkg_apis_common_v2_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_pkg_apis_common_v2_common_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_pkg_apis_common_v2_common_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_pkg_apis_common_v2_common_proto_goTypes = []interface{}{ (SizeScope)(0), // 0: common.v2.SizeScope (TaskType)(0), // 1: common.v2.TaskType @@ -1212,38 +1392,43 @@ var file_pkg_apis_common_v2_common_proto_goTypes = []interface{}{ (*Task)(nil), // 5: common.v2.Task (*Host)(nil), // 6: common.v2.Host (*Range)(nil), // 7: common.v2.Range - (*Metadata)(nil), // 8: common.v2.Metadata + (*Download)(nil), // 8: common.v2.Download (*Piece)(nil), // 9: common.v2.Piece (*ExtendAttribute)(nil), // 10: common.v2.ExtendAttribute - nil, // 11: common.v2.Metadata.HeaderEntry - nil, // 12: common.v2.ExtendAttribute.HeaderEntry - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + nil, // 11: common.v2.Task.HeaderEntry + nil, // 12: common.v2.Download.HeaderEntry + nil, // 13: common.v2.ExtendAttribute.HeaderEntry (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp } var file_pkg_apis_common_v2_common_proto_depIdxs = []int32{ - 9, // 0: common.v2.Peer.pieces:type_name -> common.v2.Piece - 5, // 1: common.v2.Peer.task:type_name -> common.v2.Task - 6, // 2: common.v2.Peer.host:type_name -> common.v2.Host - 13, // 3: common.v2.Peer.created_at:type_name -> google.protobuf.Timestamp - 13, // 4: common.v2.Peer.updated_at:type_name -> google.protobuf.Timestamp - 0, // 5: common.v2.Task.size_scope:type_name -> common.v2.SizeScope - 9, // 6: common.v2.Task.pieces:type_name -> common.v2.Piece - 8, // 7: common.v2.Task.metadata:type_name -> common.v2.Metadata - 13, // 8: common.v2.Task.created_at:type_name -> google.protobuf.Timestamp - 13, // 9: common.v2.Task.updated_at:type_name -> google.protobuf.Timestamp - 7, // 10: common.v2.Metadata.range:type_name -> common.v2.Range - 1, // 11: common.v2.Metadata.type:type_name -> common.v2.TaskType - 3, // 12: common.v2.Metadata.priority:type_name -> common.v2.Priority - 11, // 13: common.v2.Metadata.header:type_name -> common.v2.Metadata.HeaderEntry - 2, // 14: common.v2.Piece.traffic_type:type_name -> common.v2.TrafficType - 14, // 15: common.v2.Piece.cost:type_name -> google.protobuf.Duration - 13, // 16: common.v2.Piece.created_at:type_name -> google.protobuf.Timestamp - 12, // 17: common.v2.ExtendAttribute.header:type_name -> common.v2.ExtendAttribute.HeaderEntry - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 7, // 0: common.v2.Peer.range:type_name -> common.v2.Range + 3, // 1: common.v2.Peer.priority:type_name -> common.v2.Priority + 9, // 2: common.v2.Peer.pieces:type_name -> common.v2.Piece + 14, // 3: common.v2.Peer.cost:type_name -> google.protobuf.Duration + 5, // 4: common.v2.Peer.task:type_name -> common.v2.Task + 6, // 5: common.v2.Peer.host:type_name -> common.v2.Host + 15, // 6: common.v2.Peer.created_at:type_name -> google.protobuf.Timestamp + 15, // 7: common.v2.Peer.updated_at:type_name -> google.protobuf.Timestamp + 11, // 8: common.v2.Task.header:type_name -> common.v2.Task.HeaderEntry + 0, // 9: common.v2.Task.size_scope:type_name -> common.v2.SizeScope + 9, // 10: common.v2.Task.pieces:type_name -> common.v2.Piece + 15, // 11: common.v2.Task.created_at:type_name -> google.protobuf.Timestamp + 15, // 12: common.v2.Task.updated_at:type_name -> google.protobuf.Timestamp + 7, // 13: common.v2.Download.range:type_name -> common.v2.Range + 1, // 14: common.v2.Download.type:type_name -> common.v2.TaskType + 3, // 15: common.v2.Download.priority:type_name -> common.v2.Priority + 12, // 16: common.v2.Download.header:type_name -> common.v2.Download.HeaderEntry + 14, // 17: common.v2.Download.timeout:type_name -> google.protobuf.Duration + 2, // 18: common.v2.Piece.traffic_type:type_name -> common.v2.TrafficType + 14, // 19: common.v2.Piece.cost:type_name -> google.protobuf.Duration + 15, // 20: common.v2.Piece.created_at:type_name -> google.protobuf.Timestamp + 13, // 21: common.v2.ExtendAttribute.header:type_name -> common.v2.ExtendAttribute.HeaderEntry + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_pkg_apis_common_v2_common_proto_init() } @@ -1301,7 +1486,7 @@ func file_pkg_apis_common_v2_common_proto_init() { } } file_pkg_apis_common_v2_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Metadata); i { + switch v := v.(*Download); i { case 0: return &v.state case 1: @@ -1343,7 +1528,7 @@ func file_pkg_apis_common_v2_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_apis_common_v2_common_proto_rawDesc, NumEnums: 4, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/apis/common/v2/common.pb.validate.go b/pkg/apis/common/v2/common.pb.validate.go index 733c2ac..40bdd09 100644 --- a/pkg/apis/common/v2/common.pb.validate.go +++ b/pkg/apis/common/v2/common.pb.validate.go @@ -67,6 +67,46 @@ func (m *Peer) validate(all bool) error { errors = append(errors, err) } + if all { + switch v := interface{}(m.GetRange()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PeerValidationError{ + field: "Range", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PeerValidationError{ + field: "Range", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRange()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PeerValidationError{ + field: "Range", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if _, ok := Priority_name[int32(m.GetPriority())]; !ok { + err := PeerValidationError{ + field: "Priority", + reason: "value must be one of the defined enum values", + } + if !all { + return err + } + errors = append(errors, err) + } + if len(m.GetPieces()) > 0 { if len(m.GetPieces()) < 1 { @@ -116,6 +156,28 @@ func (m *Peer) validate(all bool) error { } + if m.GetCost() == nil { + err := PeerValidationError{ + field: "Cost", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if utf8.RuneCountInString(m.GetState()) < 1 { + err := PeerValidationError{ + field: "State", + reason: "value length must be at least 1 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + if m.GetTask() == nil { err := PeerValidationError{ field: "Task", @@ -196,16 +258,7 @@ func (m *Peer) validate(all bool) error { } } - if utf8.RuneCountInString(m.GetState()) < 1 { - err := PeerValidationError{ - field: "State", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } + // no validation rules for NeedBackToSource if m.GetCreatedAt() == nil { err := PeerValidationError{ @@ -349,6 +402,81 @@ func (m *Task) validate(all bool) error { errors = append(errors, err) } + if uri, err := url.Parse(m.GetUrl()); err != nil { + err = TaskValidationError{ + field: "Url", + reason: "value must be a valid URI", + cause: err, + } + if !all { + return err + } + errors = append(errors, err) + } else if !uri.IsAbs() { + err := TaskValidationError{ + field: "Url", + reason: "value must be absolute", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetDigest() != "" { + + if !_Task_Digest_Pattern.MatchString(m.GetDigest()) { + err := TaskValidationError{ + field: "Digest", + reason: "value does not match regex pattern \"^(md5)|(sha256):[A-Fa-f0-9]+$\"", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + // no validation rules for Tag + + // no validation rules for Application + + // no validation rules for Header + + if m.GetPieceSize() < 1 { + err := TaskValidationError{ + field: "PieceSize", + reason: "value must be greater than or equal to 1", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetContentLength() < 1 { + err := TaskValidationError{ + field: "ContentLength", + reason: "value must be greater than or equal to 1", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetPieceCount() < 0 { + err := TaskValidationError{ + field: "PieceCount", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + // no validation rules for SizeScope if len(m.GetPieces()) > 0 { @@ -411,57 +539,6 @@ func (m *Task) validate(all bool) error { errors = append(errors, err) } - if m.GetMetadata() == nil { - err := TaskValidationError{ - field: "Metadata", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, TaskValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, TaskValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return TaskValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if m.GetContentLength() < 1 { - err := TaskValidationError{ - field: "ContentLength", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } - if m.GetPeerCount() < 0 { err := TaskValidationError{ field: "PeerCount", @@ -581,6 +658,8 @@ var _Task_Type_InLookup = map[string]struct{}{ "weak": {}, } +var _Task_Digest_Pattern = regexp.MustCompile("^(md5)|(sha256):[A-Fa-f0-9]+$") + // Validate checks the field values on Host 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. @@ -912,22 +991,22 @@ var _ interface { ErrorName() string } = RangeValidationError{} -// Validate checks the field values on Metadata with the rules defined in the +// Validate checks the field values on Download 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 *Metadata) Validate() error { +func (m *Download) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Metadata with the rules defined in +// ValidateAll checks the field values on Download 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 MetadataMultiError, or nil +// result is a list of violation errors wrapped in DownloadMultiError, or nil // if none found. -func (m *Metadata) ValidateAll() error { +func (m *Download) ValidateAll() error { return m.validate(true) } -func (m *Metadata) validate(all bool) error { +func (m *Download) validate(all bool) error { if m == nil { return nil } @@ -935,7 +1014,7 @@ func (m *Metadata) validate(all bool) error { var errors []error if uri, err := url.Parse(m.GetUrl()); err != nil { - err = MetadataValidationError{ + err = DownloadValidationError{ field: "Url", reason: "value must be a valid URI", cause: err, @@ -945,7 +1024,7 @@ func (m *Metadata) validate(all bool) error { } errors = append(errors, err) } else if !uri.IsAbs() { - err := MetadataValidationError{ + err := DownloadValidationError{ field: "Url", reason: "value must be absolute", } @@ -957,8 +1036,8 @@ func (m *Metadata) validate(all bool) error { if m.GetDigest() != "" { - if !_Metadata_Digest_Pattern.MatchString(m.GetDigest()) { - err := MetadataValidationError{ + if !_Download_Digest_Pattern.MatchString(m.GetDigest()) { + err := DownloadValidationError{ field: "Digest", reason: "value does not match regex pattern \"^(md5)|(sha256):[A-Fa-f0-9]+$\"", } @@ -974,7 +1053,7 @@ func (m *Metadata) validate(all bool) error { switch v := interface{}(m.GetRange()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, MetadataValidationError{ + errors = append(errors, DownloadValidationError{ field: "Range", reason: "embedded message failed validation", cause: err, @@ -982,7 +1061,7 @@ func (m *Metadata) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, MetadataValidationError{ + errors = append(errors, DownloadValidationError{ field: "Range", reason: "embedded message failed validation", cause: err, @@ -991,7 +1070,7 @@ func (m *Metadata) validate(all bool) error { } } else if v, ok := interface{}(m.GetRange()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return MetadataValidationError{ + return DownloadValidationError{ field: "Range", reason: "embedded message failed validation", cause: err, @@ -1000,7 +1079,7 @@ func (m *Metadata) validate(all bool) error { } if _, ok := TaskType_name[int32(m.GetType())]; !ok { - err := MetadataValidationError{ + err := DownloadValidationError{ field: "Type", reason: "value must be one of the defined enum values", } @@ -1015,7 +1094,7 @@ func (m *Metadata) validate(all bool) error { // no validation rules for Application if _, ok := Priority_name[int32(m.GetPriority())]; !ok { - err := MetadataValidationError{ + err := DownloadValidationError{ field: "Priority", reason: "value must be one of the defined enum values", } @@ -1028,7 +1107,7 @@ func (m *Metadata) validate(all bool) error { // no validation rules for Header if m.GetPieceSize() < 1 { - err := MetadataValidationError{ + err := DownloadValidationError{ field: "PieceSize", reason: "value must be greater than or equal to 1", } @@ -1038,19 +1117,58 @@ func (m *Metadata) validate(all bool) error { errors = append(errors, err) } + if m.GetOutputPath() != "" { + + if utf8.RuneCountInString(m.GetOutputPath()) < 1 { + err := DownloadValidationError{ + field: "OutputPath", + reason: "value length must be at least 1 runes", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + + if m.GetTimeout() == nil { + err := DownloadValidationError{ + field: "Timeout", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetDownloadRateLimit() < 0 { + err := DownloadValidationError{ + field: "DownloadRateLimit", + reason: "value must be greater than or equal to 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for NeedBackToSource + if len(errors) > 0 { - return MetadataMultiError(errors) + return DownloadMultiError(errors) } return nil } -// MetadataMultiError is an error wrapping multiple validation errors returned -// by Metadata.ValidateAll() if the designated constraints aren't met. -type MetadataMultiError []error +// DownloadMultiError is an error wrapping multiple validation errors returned +// by Download.ValidateAll() if the designated constraints aren't met. +type DownloadMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m MetadataMultiError) Error() string { +func (m DownloadMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -1059,11 +1177,11 @@ func (m MetadataMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m MetadataMultiError) AllErrors() []error { return m } +func (m DownloadMultiError) AllErrors() []error { return m } -// MetadataValidationError is the validation error returned by -// Metadata.Validate if the designated constraints aren't met. -type MetadataValidationError struct { +// DownloadValidationError is the validation error returned by +// Download.Validate if the designated constraints aren't met. +type DownloadValidationError struct { field string reason string cause error @@ -1071,22 +1189,22 @@ type MetadataValidationError struct { } // Field function returns field value. -func (e MetadataValidationError) Field() string { return e.field } +func (e DownloadValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e MetadataValidationError) Reason() string { return e.reason } +func (e DownloadValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e MetadataValidationError) Cause() error { return e.cause } +func (e DownloadValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e MetadataValidationError) Key() bool { return e.key } +func (e DownloadValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e MetadataValidationError) ErrorName() string { return "MetadataValidationError" } +func (e DownloadValidationError) ErrorName() string { return "DownloadValidationError" } // Error satisfies the builtin error interface -func (e MetadataValidationError) Error() string { +func (e DownloadValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -1098,14 +1216,14 @@ func (e MetadataValidationError) Error() string { } return fmt.Sprintf( - "invalid %sMetadata.%s: %s%s", + "invalid %sDownload.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = MetadataValidationError{} +var _ error = DownloadValidationError{} var _ interface { Field() string @@ -1113,9 +1231,9 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = MetadataValidationError{} +} = DownloadValidationError{} -var _Metadata_Digest_Pattern = regexp.MustCompile("^(md5)|(sha256):[A-Fa-f0-9]+$") +var _Download_Digest_Pattern = regexp.MustCompile("^(md5)|(sha256):[A-Fa-f0-9]+$") // Validate checks the field values on Piece with the rules defined in the // proto definition for this message. If any rules are violated, the first diff --git a/pkg/apis/common/v2/common.proto b/pkg/apis/common/v2/common.proto index 919d0c2..fe5e249 100644 --- a/pkg/apis/common/v2/common.proto +++ b/pkg/apis/common/v2/common.proto @@ -107,44 +107,66 @@ enum Priority { message Peer { // Peer id. string id = 1 [(validate.rules).string.min_len = 1]; + // Range is url range of request. + Range range = 2; + // Peer priority. + Priority priority = 3 [(validate.rules).enum.defined_only = true]; // Pieces of peer. - repeated Piece pieces = 2 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; - // Task info. - Task task = 3 [(validate.rules).message.required = true]; - // Host info. - Host host = 4 [(validate.rules).message.required = true]; + repeated Piece pieces = 4 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; + // Peer downloads costs time. + google.protobuf.Duration cost = 5 [(validate.rules).duration.required = true]; // Peer state. - string state = 5 [(validate.rules).string.min_len = 1]; + string state = 6 [(validate.rules).string.min_len = 1]; + // Task info. + Task task = 7 [(validate.rules).message.required = true]; + // Host info. + Host host = 8 [(validate.rules).message.required = true]; + // NeedBackToSource needs downloaded from source. + bool need_back_to_source = 9; // Peer create time. - google.protobuf.Timestamp created_at = 6 [(validate.rules).timestamp.required = true]; + google.protobuf.Timestamp created_at = 10 [(validate.rules).timestamp.required = true]; // Peer update time. - google.protobuf.Timestamp updated_at = 7 [(validate.rules).timestamp.required = true]; + google.protobuf.Timestamp updated_at = 11 [(validate.rules).timestamp.required = true]; } // Task metadata. message Task { // Task id. string id = 1 [(validate.rules).string.min_len = 1]; - // Host type. + // Task type. string type = 2 [(validate.rules).string = {in: ["normal", "super", "strong", "weak"]}]; - // Task size scope. - SizeScope size_scope = 3; - // Pieces of task. - repeated Piece pieces = 4 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; - // Task state. - string state = 5 [(validate.rules).string.min_len = 1]; - // Task metadata. - Metadata metadata = 6 [(validate.rules).message.required = true]; + // Download url. + string url = 3 [(validate.rules).string.uri = true]; + // Digest of the pieces digest, for example md5:xxx or sha256:yyy. + string digest = 4 [(validate.rules).string = {pattern: "^(md5)|(sha256):[A-Fa-f0-9]+$", ignore_empty: true}]; + // URL tag identifies different task for same url. + string tag = 5; + // Application of task. + string application = 6; + // Filter url used to generate task id. + repeated string filters = 7; + // Task request headers. + map header = 8; + // Task piece size. + int32 piece_size = 9 [(validate.rules).int32.gte = 1]; // Task content length. - int64 content_length = 7 [(validate.rules).int64.gte = 1]; + int64 content_length = 10 [(validate.rules).int64.gte = 1]; + // Task piece count. + int64 piece_count = 11 [(validate.rules).int64.gte = 0]; + // Task size scope. + SizeScope size_scope = 12; + // Pieces of task. + repeated Piece pieces = 13 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; + // Task state. + string state = 14 [(validate.rules).string.min_len = 1]; // Task peer count. - int32 peer_count = 8 [(validate.rules).int32.gte = 0]; + int32 peer_count = 15 [(validate.rules).int32.gte = 0]; // Task contains available peer. - bool hasAvailablePeer = 9; + bool hasAvailablePeer = 16; // Task create time. - google.protobuf.Timestamp created_at = 10 [(validate.rules).timestamp.required = true]; + google.protobuf.Timestamp created_at = 17 [(validate.rules).timestamp.required = true]; // Task update time. - google.protobuf.Timestamp updated_at = 11 [(validate.rules).timestamp.required = true]; + google.protobuf.Timestamp updated_at = 18 [(validate.rules).timestamp.required = true]; } // Host metadata. @@ -175,8 +197,8 @@ message Range { uint64 end = 2; } -// Metadata represents metadata of task. -message Metadata { +// Download information. +message Download { // Download url. string url = 1 [(validate.rules).string.uri = true]; // Digest of the pieces digest, for example md5:xxx or sha256:yyy. @@ -197,6 +219,14 @@ message Metadata { map header = 9; // Task piece size. int32 piece_size = 10 [(validate.rules).int32.gte = 1]; + // File path to be exported. + string output_path = 11 [(validate.rules).string = {min_len: 1, ignore_empty: true}]; + // Download timeout. + google.protobuf.Duration timeout = 12 [(validate.rules).duration.required = true]; + // Download rate limit in bytes per second. + double download_rate_limit = 13 [(validate.rules).double.gte = 0]; + // NeedBackToSource needs downloaded from source. + bool need_back_to_source = 14; } // Piece represents information of piece. diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.pb.go b/pkg/apis/dfdaemon/v2/dfdaemon.pb.go index f722ac8..603d03e 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.pb.go +++ b/pkg/apis/dfdaemon/v2/dfdaemon.pb.go @@ -27,7 +27,6 @@ import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" @@ -128,45 +127,6 @@ func (x *InterestedPiecesRequest) GetPieceNumbers() []uint32 { return nil } -// StatMetadata represents stat metadata request of SyncPiecesRequest. -type StatMetadataRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *StatMetadataRequest) Reset() { - *x = StatMetadataRequest{} - 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 *StatMetadataRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatMetadataRequest) ProtoMessage() {} - -func (x *StatMetadataRequest) 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 StatMetadataRequest.ProtoReflect.Descriptor instead. -func (*StatMetadataRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{2} -} - // SyncPiecesRequest represents request of AnnouncePeer. type SyncPiecesRequest struct { state protoimpl.MessageState @@ -177,14 +137,13 @@ type SyncPiecesRequest struct { // // *SyncPiecesRequest_InterestedAllPiecesRequest // *SyncPiecesRequest_InterestedPiecesRequest - // *SyncPiecesRequest_StatMetadataRequest Request isSyncPiecesRequest_Request `protobuf_oneof:"request"` } func (x *SyncPiecesRequest) Reset() { *x = SyncPiecesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -197,7 +156,7 @@ func (x *SyncPiecesRequest) String() string { func (*SyncPiecesRequest) ProtoMessage() {} func (x *SyncPiecesRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] + 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 { @@ -210,7 +169,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{3} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{2} } func (m *SyncPiecesRequest) GetRequest() isSyncPiecesRequest_Request { @@ -234,13 +193,6 @@ func (x *SyncPiecesRequest) GetInterestedPiecesRequest() *InterestedPiecesReques return nil } -func (x *SyncPiecesRequest) GetStatMetadataRequest() *StatMetadataRequest { - if x, ok := x.GetRequest().(*SyncPiecesRequest_StatMetadataRequest); ok { - return x.StatMetadataRequest - } - return nil -} - type isSyncPiecesRequest_Request interface { isSyncPiecesRequest_Request() } @@ -253,16 +205,10 @@ type SyncPiecesRequest_InterestedPiecesRequest struct { InterestedPiecesRequest *InterestedPiecesRequest `protobuf:"bytes,2,opt,name=interested_pieces_request,json=interestedPiecesRequest,proto3,oneof"` } -type SyncPiecesRequest_StatMetadataRequest struct { - StatMetadataRequest *StatMetadataRequest `protobuf:"bytes,3,opt,name=stat_metadata_request,json=statMetadataRequest,proto3,oneof"` -} - func (*SyncPiecesRequest_InterestedAllPiecesRequest) isSyncPiecesRequest_Request() {} func (*SyncPiecesRequest_InterestedPiecesRequest) isSyncPiecesRequest_Request() {} -func (*SyncPiecesRequest_StatMetadataRequest) isSyncPiecesRequest_Request() {} - // InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. type InterestedPiecesResponse struct { state protoimpl.MessageState @@ -276,7 +222,7 @@ type InterestedPiecesResponse struct { func (x *InterestedPiecesResponse) Reset() { *x = InterestedPiecesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -289,7 +235,7 @@ func (x *InterestedPiecesResponse) String() string { func (*InterestedPiecesResponse) ProtoMessage() {} func (x *InterestedPiecesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] + 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 { @@ -302,7 +248,7 @@ func (x *InterestedPiecesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InterestedPiecesResponse.ProtoReflect.Descriptor instead. func (*InterestedPiecesResponse) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{3} } func (x *InterestedPiecesResponse) GetPieces() []*v2.Piece { @@ -312,55 +258,6 @@ func (x *InterestedPiecesResponse) GetPieces() []*v2.Piece { return nil } -// StatMetadata represents stat metadata request of SyncPiecesResponse. -type StatMetadataResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Task metadata. - Metadata *v2.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *StatMetadataResponse) Reset() { - *x = StatMetadataResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatMetadataResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatMetadataResponse) ProtoMessage() {} - -func (x *StatMetadataResponse) ProtoReflect() protoreflect.Message { - 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 { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StatMetadataResponse.ProtoReflect.Descriptor instead. -func (*StatMetadataResponse) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5} -} - -func (x *StatMetadataResponse) GetMetadata() *v2.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - // SyncPiecesResponse represents response of SyncPieces. type SyncPiecesResponse struct { state protoimpl.MessageState @@ -370,19 +267,17 @@ type SyncPiecesResponse struct { // Types that are assignable to Response: // // *SyncPiecesResponse_InterestedPiecesResponse - // *SyncPiecesResponse_StatMetadataResponse Response isSyncPiecesResponse_Response `protobuf_oneof:"response"` // Types that are assignable to Errordetails: // // *SyncPiecesResponse_SyncPiecesFailed - // *SyncPiecesResponse_StatMetadataFailed Errordetails isSyncPiecesResponse_Errordetails `protobuf_oneof:"errordetails"` } func (x *SyncPiecesResponse) Reset() { *x = SyncPiecesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -395,7 +290,7 @@ func (x *SyncPiecesResponse) String() string { func (*SyncPiecesResponse) ProtoMessage() {} func (x *SyncPiecesResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6] + 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 { @@ -408,7 +303,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{6} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{4} } func (m *SyncPiecesResponse) GetResponse() isSyncPiecesResponse_Response { @@ -425,13 +320,6 @@ func (x *SyncPiecesResponse) GetInterestedPiecesResponse() *InterestedPiecesResp return nil } -func (x *SyncPiecesResponse) GetStatMetadataResponse() *StatMetadataResponse { - if x, ok := x.GetResponse().(*SyncPiecesResponse_StatMetadataResponse); ok { - return x.StatMetadataResponse - } - return nil -} - func (m *SyncPiecesResponse) GetErrordetails() isSyncPiecesResponse_Errordetails { if m != nil { return m.Errordetails @@ -446,13 +334,6 @@ func (x *SyncPiecesResponse) GetSyncPiecesFailed() *v21.SyncPiecesFailed { return nil } -func (x *SyncPiecesResponse) GetStatMetadataFailed() *v21.StatMetadataFailed { - if x, ok := x.GetErrordetails().(*SyncPiecesResponse_StatMetadataFailed); ok { - return x.StatMetadataFailed - } - return nil -} - type isSyncPiecesResponse_Response interface { isSyncPiecesResponse_Response() } @@ -461,14 +342,8 @@ type SyncPiecesResponse_InterestedPiecesResponse struct { InterestedPiecesResponse *InterestedPiecesResponse `protobuf:"bytes,1,opt,name=interested_pieces_response,json=interestedPiecesResponse,proto3,oneof"` } -type SyncPiecesResponse_StatMetadataResponse struct { - StatMetadataResponse *StatMetadataResponse `protobuf:"bytes,2,opt,name=stat_metadata_response,json=statMetadataResponse,proto3,oneof"` -} - func (*SyncPiecesResponse_InterestedPiecesResponse) isSyncPiecesResponse_Response() {} -func (*SyncPiecesResponse_StatMetadataResponse) isSyncPiecesResponse_Response() {} - type isSyncPiecesResponse_Errordetails interface { isSyncPiecesResponse_Errordetails() } @@ -477,30 +352,22 @@ type SyncPiecesResponse_SyncPiecesFailed struct { SyncPiecesFailed *v21.SyncPiecesFailed `protobuf:"bytes,3,opt,name=sync_pieces_failed,json=syncPiecesFailed,proto3,oneof"` } -type SyncPiecesResponse_StatMetadataFailed struct { - StatMetadataFailed *v21.StatMetadataFailed `protobuf:"bytes,4,opt,name=stat_metadata_failed,json=statMetadataFailed,proto3,oneof"` -} - func (*SyncPiecesResponse_SyncPiecesFailed) isSyncPiecesResponse_Errordetails() {} -func (*SyncPiecesResponse_StatMetadataFailed) isSyncPiecesResponse_Errordetails() {} - // DownloadTaskRequest represents request of DownloadTask. type DownloadTaskRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Task id. - TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - // Task metadata. - Metadata *v2.Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Download information. + Download *v2.Download `protobuf:"bytes,1,opt,name=download,proto3" json:"download,omitempty"` } func (x *DownloadTaskRequest) Reset() { *x = DownloadTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +380,7 @@ func (x *DownloadTaskRequest) String() string { func (*DownloadTaskRequest) ProtoMessage() {} func (x *DownloadTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] + 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 { @@ -526,19 +393,61 @@ func (x *DownloadTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DownloadTaskRequest.ProtoReflect.Descriptor instead. func (*DownloadTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{5} } -func (x *DownloadTaskRequest) GetTaskId() string { +func (x *DownloadTaskRequest) GetDownload() *v2.Download { if x != nil { - return x.TaskId + return x.Download } - return "" + return nil } -func (x *DownloadTaskRequest) GetMetadata() *v2.Metadata { +// UploadTaskRequest represents request of UploadTask. +type UploadTaskRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Task metadata. + Task *v2.Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` +} + +func (x *UploadTaskRequest) Reset() { + *x = UploadTaskRequest{} + 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 *UploadTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadTaskRequest) ProtoMessage() {} + +func (x *UploadTaskRequest) 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 UploadTaskRequest.ProtoReflect.Descriptor instead. +func (*UploadTaskRequest) Descriptor() ([]byte, []int) { + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{6} +} + +func (x *UploadTaskRequest) GetTask() *v2.Task { if x != nil { - return x.Metadata + return x.Task } return nil } @@ -556,7 +465,7 @@ type StatTaskRequest struct { func (x *StatTaskRequest) Reset() { *x = StatTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +478,7 @@ func (x *StatTaskRequest) String() string { func (*StatTaskRequest) ProtoMessage() {} 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[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,7 +491,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{8} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{7} } func (x *StatTaskRequest) GetTaskId() string { @@ -598,13 +507,14 @@ type StatTaskResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Task metadata. Task *v2.Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` } func (x *StatTaskResponse) Reset() { *x = StatTaskResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +527,7 @@ func (x *StatTaskResponse) String() string { func (*StatTaskResponse) ProtoMessage() {} func (x *StatTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] + 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 { @@ -630,7 +540,7 @@ func (x *StatTaskResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatTaskResponse.ProtoReflect.Descriptor instead. func (*StatTaskResponse) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{9} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{8} } func (x *StatTaskResponse) GetTask() *v2.Task { @@ -640,158 +550,6 @@ func (x *StatTaskResponse) GetTask() *v2.Task { return nil } -// ImportTaskRequest represents request of ImportTask. -type ImportTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Task metadata. - Metadata *v2.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // File path to be imported. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *ImportTaskRequest) Reset() { - *x = ImportTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImportTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImportTaskRequest) ProtoMessage() {} - -func (x *ImportTaskRequest) ProtoReflect() protoreflect.Message { - 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 { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImportTaskRequest.ProtoReflect.Descriptor instead. -func (*ImportTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{10} -} - -func (x *ImportTaskRequest) GetMetadata() *v2.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *ImportTaskRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// ExportTaskRequest represents request of ExportTask. -type ExportTaskRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Task metadata. - Metadata *v2.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` - // File path to be exported. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - // Download timeout. - Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - // Download rate limit in bytes per second. - DownloadRateLimit float64 `protobuf:"fixed64,4,opt,name=download_rate_limit,json=downloadRateLimit,proto3" json:"download_rate_limit,omitempty"` - // User id. - Uid uint64 `protobuf:"varint,5,opt,name=uid,proto3" json:"uid,omitempty"` - // Group id. - Gid uint64 `protobuf:"varint,6,opt,name=gid,proto3" json:"gid,omitempty"` -} - -func (x *ExportTaskRequest) Reset() { - *x = ExportTaskRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExportTaskRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExportTaskRequest) ProtoMessage() {} - -func (x *ExportTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[11] - 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 ExportTaskRequest.ProtoReflect.Descriptor instead. -func (*ExportTaskRequest) Descriptor() ([]byte, []int) { - return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{11} -} - -func (x *ExportTaskRequest) GetMetadata() *v2.Metadata { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *ExportTaskRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ExportTaskRequest) GetTimeout() *durationpb.Duration { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *ExportTaskRequest) GetDownloadRateLimit() float64 { - if x != nil { - return x.DownloadRateLimit - } - return 0 -} - -func (x *ExportTaskRequest) GetUid() uint64 { - if x != nil { - return x.Uid - } - return 0 -} - -func (x *ExportTaskRequest) GetGid() uint64 { - if x != nil { - return x.Gid - } - return 0 -} - // DeleteTaskRequest represents request of DeleteTask. type DeleteTaskRequest struct { state protoimpl.MessageState @@ -805,7 +563,7 @@ type DeleteTaskRequest struct { func (x *DeleteTaskRequest) Reset() { *x = DeleteTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[12] + mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -818,7 +576,7 @@ func (x *DeleteTaskRequest) String() string { func (*DeleteTaskRequest) ProtoMessage() {} func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[12] + 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 { @@ -831,7 +589,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{12} + return file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDescGZIP(), []int{9} } func (x *DeleteTaskRequest) GetTaskId() string { @@ -852,8 +610,6 @@ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, @@ -863,140 +619,90 @@ var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc = []byte{ 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x0d, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, - 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x15, - 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xcd, 0x02, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6c, 0x0a, 0x1d, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x1a, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x62, 0x0a, 0x19, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, - 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x56, 0x0a, - 0x15, 0x73, 0x74, 0x61, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, - 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, - 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x50, 0x0a, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, 0x52, - 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa3, 0x03, 0x0a, 0x12, 0x53, - 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x65, 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, - 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0xf5, + 0x01, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x6c, 0x0a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x64, 0x66, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x62, 0x0a, 0x19, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, - 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x18, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x73, - 0x74, 0x61, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x12, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x48, 0x01, 0x52, 0x10, 0x73, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, - 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x57, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x48, 0x01, 0x52, 0x12, 0x73, 0x74, 0x61, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, - 0x0f, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, - 0x42, 0x0e, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, - 0x22, 0x72, 0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 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, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x10, 0x53, 0x74, 0x61, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x6b, 0x0a, 0x11, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x50, 0x0a, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, + 0x69, 0x65, 0x63, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x92, 0x01, 0x04, 0x08, 0x01, 0x28, 0x01, + 0x52, 0x06, 0x70, 0x69, 0x65, 0x63, 0x65, 0x73, 0x22, 0xef, 0x01, 0x0a, 0x12, 0x53, 0x79, 0x6e, + 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x65, 0x0a, 0x1a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x69, + 0x65, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x32, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x18, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x12, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x70, + 0x69, 0x65, 0x63, 0x65, 0x73, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x48, 0x01, 0x52, 0x10, 0x73, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, + 0x63, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x0f, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x50, 0x0a, 0x13, 0x44, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x39, 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xa0, 0x02, 0x0a, 0x11, 0x45, 0x78, - 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x3d, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x13, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x01, 0x42, 0x0e, 0xfa, 0x42, 0x0b, 0x12, 0x09, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x52, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x12, 0x19, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x00, 0x52, 0x03, 0x67, 0x69, 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, 0xb4, 0x03, 0x0a, 0x08, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, - 0x12, 0x51, 0x0a, 0x0a, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1e, - 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, - 0x01, 0x30, 0x01, 0x12, 0x48, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, - 0x61, 0x73, 0x6b, 0x12, 0x20, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x32, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x39, 0x0a, - 0x08, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1c, 0x2e, 0x64, 0x66, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x44, 0x0a, 0x0a, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, - 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, - 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0a, 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, 0x2a, 0x5a, 0x28, 0x64, 0x37, - 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x42, 0x0a, 0x11, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x73, 0x6b, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, + 0x22, 0x33, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x54, 0x61, 0x73, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x35, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, + 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x32, + 0xee, 0x02, 0x0a, 0x08, 0x44, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0a, + 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x66, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, + 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, + 0x48, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x20, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x44, 0x0a, 0x0a, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x61, 0x73, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x2a, 0x5a, 0x28, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 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 ( @@ -1011,61 +717,48 @@ 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, 13) +var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_goTypes = []interface{}{ (*InterestedAllPiecesRequest)(nil), // 0: dfdaemon.v2.InterestedAllPiecesRequest (*InterestedPiecesRequest)(nil), // 1: dfdaemon.v2.InterestedPiecesRequest - (*StatMetadataRequest)(nil), // 2: dfdaemon.v2.StatMetadataRequest - (*SyncPiecesRequest)(nil), // 3: dfdaemon.v2.SyncPiecesRequest - (*InterestedPiecesResponse)(nil), // 4: dfdaemon.v2.InterestedPiecesResponse - (*StatMetadataResponse)(nil), // 5: dfdaemon.v2.StatMetadataResponse - (*SyncPiecesResponse)(nil), // 6: dfdaemon.v2.SyncPiecesResponse - (*DownloadTaskRequest)(nil), // 7: dfdaemon.v2.DownloadTaskRequest - (*StatTaskRequest)(nil), // 8: dfdaemon.v2.StatTaskRequest - (*StatTaskResponse)(nil), // 9: dfdaemon.v2.StatTaskResponse - (*ImportTaskRequest)(nil), // 10: dfdaemon.v2.ImportTaskRequest - (*ExportTaskRequest)(nil), // 11: dfdaemon.v2.ExportTaskRequest - (*DeleteTaskRequest)(nil), // 12: dfdaemon.v2.DeleteTaskRequest - (*v2.Piece)(nil), // 13: common.v2.Piece - (*v2.Metadata)(nil), // 14: common.v2.Metadata - (*v21.SyncPiecesFailed)(nil), // 15: errordetails.v2.SyncPiecesFailed - (*v21.StatMetadataFailed)(nil), // 16: errordetails.v2.StatMetadataFailed - (*v2.Task)(nil), // 17: common.v2.Task - (*durationpb.Duration)(nil), // 18: google.protobuf.Duration - (*emptypb.Empty)(nil), // 19: google.protobuf.Empty + (*SyncPiecesRequest)(nil), // 2: dfdaemon.v2.SyncPiecesRequest + (*InterestedPiecesResponse)(nil), // 3: dfdaemon.v2.InterestedPiecesResponse + (*SyncPiecesResponse)(nil), // 4: dfdaemon.v2.SyncPiecesResponse + (*DownloadTaskRequest)(nil), // 5: dfdaemon.v2.DownloadTaskRequest + (*UploadTaskRequest)(nil), // 6: dfdaemon.v2.UploadTaskRequest + (*StatTaskRequest)(nil), // 7: dfdaemon.v2.StatTaskRequest + (*StatTaskResponse)(nil), // 8: dfdaemon.v2.StatTaskResponse + (*DeleteTaskRequest)(nil), // 9: dfdaemon.v2.DeleteTaskRequest + (*v2.Piece)(nil), // 10: common.v2.Piece + (*v21.SyncPiecesFailed)(nil), // 11: errordetails.v2.SyncPiecesFailed + (*v2.Download)(nil), // 12: common.v2.Download + (*v2.Task)(nil), // 13: common.v2.Task + (*emptypb.Empty)(nil), // 14: google.protobuf.Empty } var file_pkg_apis_dfdaemon_v2_dfdaemon_proto_depIdxs = []int32{ 0, // 0: dfdaemon.v2.SyncPiecesRequest.interested_all_pieces_request:type_name -> dfdaemon.v2.InterestedAllPiecesRequest 1, // 1: dfdaemon.v2.SyncPiecesRequest.interested_pieces_request:type_name -> dfdaemon.v2.InterestedPiecesRequest - 2, // 2: dfdaemon.v2.SyncPiecesRequest.stat_metadata_request:type_name -> dfdaemon.v2.StatMetadataRequest - 13, // 3: dfdaemon.v2.InterestedPiecesResponse.pieces:type_name -> common.v2.Piece - 14, // 4: dfdaemon.v2.StatMetadataResponse.metadata:type_name -> common.v2.Metadata - 4, // 5: dfdaemon.v2.SyncPiecesResponse.interested_pieces_response:type_name -> dfdaemon.v2.InterestedPiecesResponse - 5, // 6: dfdaemon.v2.SyncPiecesResponse.stat_metadata_response:type_name -> dfdaemon.v2.StatMetadataResponse - 15, // 7: dfdaemon.v2.SyncPiecesResponse.sync_pieces_failed:type_name -> errordetails.v2.SyncPiecesFailed - 16, // 8: dfdaemon.v2.SyncPiecesResponse.stat_metadata_failed:type_name -> errordetails.v2.StatMetadataFailed - 14, // 9: dfdaemon.v2.DownloadTaskRequest.metadata:type_name -> common.v2.Metadata - 17, // 10: dfdaemon.v2.StatTaskResponse.task:type_name -> common.v2.Task - 14, // 11: dfdaemon.v2.ImportTaskRequest.metadata:type_name -> common.v2.Metadata - 14, // 12: dfdaemon.v2.ExportTaskRequest.metadata:type_name -> common.v2.Metadata - 18, // 13: dfdaemon.v2.ExportTaskRequest.timeout:type_name -> google.protobuf.Duration - 3, // 14: dfdaemon.v2.Dfdaemon.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest - 7, // 15: dfdaemon.v2.Dfdaemon.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest - 8, // 16: dfdaemon.v2.Dfdaemon.StatTask:input_type -> dfdaemon.v2.StatTaskRequest - 10, // 17: dfdaemon.v2.Dfdaemon.ImportTask:input_type -> dfdaemon.v2.ImportTaskRequest - 11, // 18: dfdaemon.v2.Dfdaemon.ExportTask:input_type -> dfdaemon.v2.ExportTaskRequest - 12, // 19: dfdaemon.v2.Dfdaemon.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest - 6, // 20: dfdaemon.v2.Dfdaemon.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse - 19, // 21: dfdaemon.v2.Dfdaemon.DownloadTask:output_type -> google.protobuf.Empty - 17, // 22: dfdaemon.v2.Dfdaemon.StatTask:output_type -> common.v2.Task - 19, // 23: dfdaemon.v2.Dfdaemon.ImportTask:output_type -> google.protobuf.Empty - 19, // 24: dfdaemon.v2.Dfdaemon.ExportTask:output_type -> google.protobuf.Empty - 19, // 25: dfdaemon.v2.Dfdaemon.DeleteTask:output_type -> google.protobuf.Empty - 20, // [20:26] is the sub-list for method output_type - 14, // [14:20] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 10, // 2: dfdaemon.v2.InterestedPiecesResponse.pieces:type_name -> common.v2.Piece + 3, // 3: dfdaemon.v2.SyncPiecesResponse.interested_pieces_response:type_name -> dfdaemon.v2.InterestedPiecesResponse + 11, // 4: dfdaemon.v2.SyncPiecesResponse.sync_pieces_failed:type_name -> errordetails.v2.SyncPiecesFailed + 12, // 5: dfdaemon.v2.DownloadTaskRequest.download:type_name -> common.v2.Download + 13, // 6: dfdaemon.v2.UploadTaskRequest.task:type_name -> common.v2.Task + 13, // 7: dfdaemon.v2.StatTaskResponse.task:type_name -> common.v2.Task + 2, // 8: dfdaemon.v2.Dfdaemon.SyncPieces:input_type -> dfdaemon.v2.SyncPiecesRequest + 5, // 9: dfdaemon.v2.Dfdaemon.DownloadTask:input_type -> dfdaemon.v2.DownloadTaskRequest + 6, // 10: dfdaemon.v2.Dfdaemon.UploadTask:input_type -> dfdaemon.v2.UploadTaskRequest + 7, // 11: dfdaemon.v2.Dfdaemon.StatTask:input_type -> dfdaemon.v2.StatTaskRequest + 9, // 12: dfdaemon.v2.Dfdaemon.DeleteTask:input_type -> dfdaemon.v2.DeleteTaskRequest + 4, // 13: dfdaemon.v2.Dfdaemon.SyncPieces:output_type -> dfdaemon.v2.SyncPiecesResponse + 14, // 14: dfdaemon.v2.Dfdaemon.DownloadTask:output_type -> google.protobuf.Empty + 14, // 15: dfdaemon.v2.Dfdaemon.UploadTask:output_type -> google.protobuf.Empty + 13, // 16: dfdaemon.v2.Dfdaemon.StatTask:output_type -> common.v2.Task + 14, // 17: dfdaemon.v2.Dfdaemon.DeleteTask:output_type -> google.protobuf.Empty + 13, // [13:18] is the sub-list for method output_type + 8, // [8:13] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() } @@ -1099,18 +792,6 @@ 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.(*StatMetadataRequest); 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[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncPiecesRequest); i { case 0: return &v.state @@ -1122,7 +803,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InterestedPiecesResponse); i { case 0: return &v.state @@ -1134,19 +815,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatMetadataResponse); 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[6].Exporter = func(v interface{}, i int) interface{} { + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncPiecesResponse); i { case 0: return &v.state @@ -1158,7 +827,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DownloadTaskRequest); i { case 0: return &v.state @@ -1170,7 +839,19 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[8].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.(*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[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StatTaskRequest); i { case 0: return &v.state @@ -1182,7 +863,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].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.(*StatTaskResponse); i { case 0: return &v.state @@ -1194,31 +875,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { return nil } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportTaskRequest); 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.(*ExportTaskRequest); 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{} { + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteTaskRequest); i { case 0: return &v.state @@ -1231,16 +888,13 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { } } } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[3].OneofWrappers = []interface{}{ + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[2].OneofWrappers = []interface{}{ (*SyncPiecesRequest_InterestedAllPiecesRequest)(nil), (*SyncPiecesRequest_InterestedPiecesRequest)(nil), - (*SyncPiecesRequest_StatMetadataRequest)(nil), } - file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_pkg_apis_dfdaemon_v2_dfdaemon_proto_msgTypes[4].OneofWrappers = []interface{}{ (*SyncPiecesResponse_InterestedPiecesResponse)(nil), - (*SyncPiecesResponse_StatMetadataResponse)(nil), (*SyncPiecesResponse_SyncPiecesFailed)(nil), - (*SyncPiecesResponse_StatMetadataFailed)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1248,7 +902,7 @@ func file_pkg_apis_dfdaemon_v2_dfdaemon_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_apis_dfdaemon_v2_dfdaemon_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go b/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go index 52c13a8..8689e37 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go +++ b/pkg/apis/dfdaemon/v2/dfdaemon.pb.validate.go @@ -250,108 +250,6 @@ var _ interface { ErrorName() string } = InterestedPiecesRequestValidationError{} -// Validate checks the field values on StatMetadataRequest 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 *StatMetadataRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StatMetadataRequest 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 -// StatMetadataRequestMultiError, or nil if none found. -func (m *StatMetadataRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *StatMetadataRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return StatMetadataRequestMultiError(errors) - } - - return nil -} - -// StatMetadataRequestMultiError is an error wrapping multiple validation -// errors returned by StatMetadataRequest.ValidateAll() if the designated -// constraints aren't met. -type StatMetadataRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatMetadataRequestMultiError) 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 StatMetadataRequestMultiError) AllErrors() []error { return m } - -// StatMetadataRequestValidationError is the validation error returned by -// StatMetadataRequest.Validate if the designated constraints aren't met. -type StatMetadataRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatMetadataRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatMetadataRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatMetadataRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatMetadataRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatMetadataRequestValidationError) ErrorName() string { - return "StatMetadataRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e StatMetadataRequestValidationError) 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 %sStatMetadataRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatMetadataRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatMetadataRequestValidationError{} - // Validate checks the field values on SyncPiecesRequest 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. @@ -460,48 +358,6 @@ func (m *SyncPiecesRequest) validate(all bool) error { } } - case *SyncPiecesRequest_StatMetadataRequest: - if v == nil { - err := SyncPiecesRequestValidationError{ - 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.GetStatMetadataRequest()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SyncPiecesRequestValidationError{ - field: "StatMetadataRequest", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SyncPiecesRequestValidationError{ - field: "StatMetadataRequest", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStatMetadataRequest()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SyncPiecesRequestValidationError{ - field: "StatMetadataRequest", - reason: "embedded message failed validation", - cause: err, - } - } - } - default: _ = v // ensures v is used } @@ -747,148 +603,6 @@ var _ interface { ErrorName() string } = InterestedPiecesResponseValidationError{} -// Validate checks the field values on StatMetadataResponse 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 *StatMetadataResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StatMetadataResponse 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 -// StatMetadataResponseMultiError, or nil if none found. -func (m *StatMetadataResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *StatMetadataResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetMetadata() == nil { - err := StatMetadataResponseValidationError{ - field: "Metadata", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, StatMetadataResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, StatMetadataResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return StatMetadataResponseValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return StatMetadataResponseMultiError(errors) - } - - return nil -} - -// StatMetadataResponseMultiError is an error wrapping multiple validation -// errors returned by StatMetadataResponse.ValidateAll() if the designated -// constraints aren't met. -type StatMetadataResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatMetadataResponseMultiError) 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 StatMetadataResponseMultiError) AllErrors() []error { return m } - -// StatMetadataResponseValidationError is the validation error returned by -// StatMetadataResponse.Validate if the designated constraints aren't met. -type StatMetadataResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatMetadataResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatMetadataResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatMetadataResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatMetadataResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatMetadataResponseValidationError) ErrorName() string { - return "StatMetadataResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e StatMetadataResponseValidationError) 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 %sStatMetadataResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatMetadataResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatMetadataResponseValidationError{} - // Validate checks the field values on SyncPiecesResponse 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. @@ -955,48 +669,6 @@ func (m *SyncPiecesResponse) validate(all bool) error { } } - case *SyncPiecesResponse_StatMetadataResponse: - if v == nil { - err := SyncPiecesResponseValidationError{ - field: "Response", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofResponsePresent = true - - if all { - switch v := interface{}(m.GetStatMetadataResponse()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SyncPiecesResponseValidationError{ - field: "StatMetadataResponse", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SyncPiecesResponseValidationError{ - field: "StatMetadataResponse", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStatMetadataResponse()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SyncPiecesResponseValidationError{ - field: "StatMetadataResponse", - reason: "embedded message failed validation", - cause: err, - } - } - } - default: _ = v // ensures v is used } @@ -1052,47 +724,6 @@ func (m *SyncPiecesResponse) validate(all bool) error { } } - case *SyncPiecesResponse_StatMetadataFailed: - if v == nil { - err := SyncPiecesResponseValidationError{ - field: "Errordetails", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetStatMetadataFailed()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SyncPiecesResponseValidationError{ - field: "StatMetadataFailed", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SyncPiecesResponseValidationError{ - field: "StatMetadataFailed", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetStatMetadataFailed()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return SyncPiecesResponseValidationError{ - field: "StatMetadataFailed", - reason: "embedded message failed validation", - cause: err, - } - } - } - default: _ = v // ensures v is used } @@ -1199,20 +830,9 @@ func (m *DownloadTaskRequest) validate(all bool) error { var errors []error - if utf8.RuneCountInString(m.GetTaskId()) < 1 { + if m.GetDownload() == nil { err := DownloadTaskRequestValidationError{ - field: "TaskId", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetMetadata() == nil { - err := DownloadTaskRequestValidationError{ - field: "Metadata", + field: "Download", reason: "value is required", } if !all { @@ -1222,11 +842,11 @@ func (m *DownloadTaskRequest) validate(all bool) error { } if all { - switch v := interface{}(m.GetMetadata()).(type) { + switch v := interface{}(m.GetDownload()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, DownloadTaskRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, }) @@ -1234,16 +854,16 @@ func (m *DownloadTaskRequest) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, DownloadTaskRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetDownload()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DownloadTaskRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, } @@ -1330,6 +950,148 @@ var _ interface { ErrorName() string } = DownloadTaskRequestValidationError{} +// Validate checks the field values on UploadTaskRequest 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 *UploadTaskRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UploadTaskRequest 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 +// UploadTaskRequestMultiError, or nil if none found. +func (m *UploadTaskRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UploadTaskRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetTask() == nil { + err := UploadTaskRequestValidationError{ + field: "Task", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetTask()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadTaskRequestValidationError{ + field: "Task", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadTaskRequestValidationError{ + field: "Task", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetTask()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadTaskRequestValidationError{ + field: "Task", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UploadTaskRequestMultiError(errors) + } + + return nil +} + +// UploadTaskRequestMultiError is an error wrapping multiple validation errors +// returned by UploadTaskRequest.ValidateAll() if the designated constraints +// aren't met. +type UploadTaskRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadTaskRequestMultiError) 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 UploadTaskRequestMultiError) AllErrors() []error { return m } + +// UploadTaskRequestValidationError is the validation error returned by +// UploadTaskRequest.Validate if the designated constraints aren't met. +type UploadTaskRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UploadTaskRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadTaskRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadTaskRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadTaskRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadTaskRequestValidationError) ErrorName() string { + return "UploadTaskRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UploadTaskRequestValidationError) 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 %sUploadTaskRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadTaskRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadTaskRequestValidationError{} + // Validate checks the field values on StatTaskRequest 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. @@ -1581,356 +1343,6 @@ var _ interface { ErrorName() string } = StatTaskResponseValidationError{} -// Validate checks the field values on ImportTaskRequest 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 *ImportTaskRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ImportTaskRequest 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 -// ImportTaskRequestMultiError, or nil if none found. -func (m *ImportTaskRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ImportTaskRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetMetadata() == nil { - err := ImportTaskRequestValidationError{ - field: "Metadata", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ImportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ImportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ImportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetPath()) < 1 { - err := ImportTaskRequestValidationError{ - field: "Path", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ImportTaskRequestMultiError(errors) - } - - return nil -} - -// ImportTaskRequestMultiError is an error wrapping multiple validation errors -// returned by ImportTaskRequest.ValidateAll() if the designated constraints -// aren't met. -type ImportTaskRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ImportTaskRequestMultiError) 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 ImportTaskRequestMultiError) AllErrors() []error { return m } - -// ImportTaskRequestValidationError is the validation error returned by -// ImportTaskRequest.Validate if the designated constraints aren't met. -type ImportTaskRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ImportTaskRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ImportTaskRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ImportTaskRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ImportTaskRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ImportTaskRequestValidationError) ErrorName() string { - return "ImportTaskRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ImportTaskRequestValidationError) 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 %sImportTaskRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ImportTaskRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ImportTaskRequestValidationError{} - -// Validate checks the field values on ExportTaskRequest 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 *ExportTaskRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ExportTaskRequest 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 -// ExportTaskRequestMultiError, or nil if none found. -func (m *ExportTaskRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ExportTaskRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetMetadata() == nil { - err := ExportTaskRequestValidationError{ - field: "Metadata", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ExportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ExportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ExportTaskRequestValidationError{ - field: "Metadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if utf8.RuneCountInString(m.GetPath()) < 1 { - err := ExportTaskRequestValidationError{ - field: "Path", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetTimeout() == nil { - err := ExportTaskRequestValidationError{ - field: "Timeout", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetDownloadRateLimit() < 0 { - err := ExportTaskRequestValidationError{ - field: "DownloadRateLimit", - reason: "value must be greater than or equal to 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetUid() < 0 { - err := ExportTaskRequestValidationError{ - field: "Uid", - reason: "value must be greater than or equal to 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if m.GetGid() < 0 { - err := ExportTaskRequestValidationError{ - field: "Gid", - reason: "value must be greater than or equal to 0", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return ExportTaskRequestMultiError(errors) - } - - return nil -} - -// ExportTaskRequestMultiError is an error wrapping multiple validation errors -// returned by ExportTaskRequest.ValidateAll() if the designated constraints -// aren't met. -type ExportTaskRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ExportTaskRequestMultiError) 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 ExportTaskRequestMultiError) AllErrors() []error { return m } - -// ExportTaskRequestValidationError is the validation error returned by -// ExportTaskRequest.Validate if the designated constraints aren't met. -type ExportTaskRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ExportTaskRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ExportTaskRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ExportTaskRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ExportTaskRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ExportTaskRequestValidationError) ErrorName() string { - return "ExportTaskRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ExportTaskRequestValidationError) 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 %sExportTaskRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ExportTaskRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ExportTaskRequestValidationError{} - // Validate checks the field values on DeleteTaskRequest 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. diff --git a/pkg/apis/dfdaemon/v2/dfdaemon.proto b/pkg/apis/dfdaemon/v2/dfdaemon.proto index 4e2d732..1b488f2 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon.proto +++ b/pkg/apis/dfdaemon/v2/dfdaemon.proto @@ -20,7 +20,6 @@ package dfdaemon.v2; import "pkg/apis/common/v2/common.proto"; import "pkg/apis/errordetails/v2/errordetails.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "validate/validate.proto"; @@ -36,10 +35,6 @@ message InterestedPiecesRequest { repeated uint32 piece_numbers = 1 [(validate.rules).repeated = {min_items: 1}]; } -// StatMetadata represents stat metadata request of SyncPiecesRequest. -message StatMetadataRequest { -} - // SyncPiecesRequest represents request of AnnouncePeer. message SyncPiecesRequest{ oneof request { @@ -47,7 +42,6 @@ message SyncPiecesRequest{ InterestedAllPiecesRequest interested_all_pieces_request = 1; InterestedPiecesRequest interested_pieces_request = 2; - StatMetadataRequest stat_metadata_request = 3; } } @@ -57,33 +51,29 @@ message InterestedPiecesResponse { repeated common.v2.Piece pieces = 1 [(validate.rules).repeated = {min_items: 1, ignore_empty: true}]; } -// StatMetadata represents stat metadata request of SyncPiecesResponse. -message StatMetadataResponse { - // Task metadata. - common.v2.Metadata metadata = 1 [(validate.rules).message.required = true]; -} - // SyncPiecesResponse represents response of SyncPieces. message SyncPiecesResponse { oneof response { option (validate.required) = true; InterestedPiecesResponse interested_pieces_response = 1; - StatMetadataResponse stat_metadata_response = 2; } oneof errordetails { errordetails.v2.SyncPiecesFailed sync_pieces_failed = 3; - errordetails.v2.StatMetadataFailed stat_metadata_failed = 4; } } // DownloadTaskRequest represents request of DownloadTask. message DownloadTaskRequest { - // Task id. - string task_id = 1 [(validate.rules).string.min_len = 1]; + // Download information. + common.v2.Download download = 1 [(validate.rules).message.required = true]; +} + +// UploadTaskRequest represents request of UploadTask. +message UploadTaskRequest { // Task metadata. - common.v2.Metadata metadata = 2 [(validate.rules).message.required = true]; + common.v2.Task task = 1 [(validate.rules).message.required = true]; } // StatTaskRequest represents request of StatTask. @@ -94,33 +84,10 @@ message StatTaskRequest { // StatTaskResponse represents response of StatTask. message StatTaskResponse { + // Task metadata. common.v2.Task task = 1 [(validate.rules).message.required = true]; } -// ImportTaskRequest represents request of ImportTask. -message ImportTaskRequest { - // Task metadata. - common.v2.Metadata metadata = 1 [(validate.rules).message.required = true]; - // File path to be imported. - string path = 2 [(validate.rules).string.min_len = 1]; -} - -// ExportTaskRequest represents request of ExportTask. -message ExportTaskRequest { - // Task metadata. - common.v2.Metadata metadata = 1 [(validate.rules).message.required = true]; - // File path to be exported. - string path = 2 [(validate.rules).string.min_len = 1]; - // Download timeout. - google.protobuf.Duration timeout = 3 [(validate.rules).duration.required = true]; - // Download rate limit in bytes per second. - double download_rate_limit = 4 [(validate.rules).double.gte = 0]; - // User id. - uint64 uid = 5 [(validate.rules).uint64.gte = 0]; - // Group id. - uint64 gid = 6 [(validate.rules).uint64.gte = 0]; -} - // DeleteTaskRequest represents request of DeleteTask. message DeleteTaskRequest { // Task id. @@ -135,15 +102,12 @@ service Dfdaemon{ // DownloadTask downloads task back-to-source. rpc DownloadTask(DownloadTaskRequest) returns(google.protobuf.Empty); + // UploadTask uploads task to p2p network. + rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty); + // StatTask stats task information. rpc StatTask(StatTaskRequest) returns(common.v2.Task); - // ImportTask imports task to p2p network. - rpc ImportTask(ImportTaskRequest) returns(google.protobuf.Empty); - - // ExportTask exports task from p2p network. - rpc ExportTask(ExportTaskRequest) returns(google.protobuf.Empty); - // DeleteTask deletes task from p2p network. rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty); } diff --git a/pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go b/pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go index ac90154..379d33e 100644 --- a/pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go +++ b/pkg/apis/dfdaemon/v2/dfdaemon_grpc.pb.go @@ -28,12 +28,10 @@ type DfdaemonClient interface { SyncPieces(ctx context.Context, opts ...grpc.CallOption) (Dfdaemon_SyncPiecesClient, error) // DownloadTask downloads task back-to-source. DownloadTask(ctx context.Context, in *DownloadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // UploadTask uploads task to p2p network. + UploadTask(ctx context.Context, in *UploadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // StatTask stats task information. StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) - // ImportTask imports task to p2p network. - ImportTask(ctx context.Context, in *ImportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // ExportTask exports task from p2p network. - ExportTask(ctx context.Context, in *ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // DeleteTask deletes task from p2p network. DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) } @@ -86,6 +84,15 @@ func (c *dfdaemonClient) DownloadTask(ctx context.Context, in *DownloadTaskReque return out, nil } +func (c *dfdaemonClient) UploadTask(ctx context.Context, in *UploadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/dfdaemon.v2.Dfdaemon/UploadTask", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *dfdaemonClient) StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*v2.Task, error) { out := new(v2.Task) err := c.cc.Invoke(ctx, "/dfdaemon.v2.Dfdaemon/StatTask", in, out, opts...) @@ -95,24 +102,6 @@ func (c *dfdaemonClient) StatTask(ctx context.Context, in *StatTaskRequest, opts return out, nil } -func (c *dfdaemonClient) ImportTask(ctx context.Context, in *ImportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/dfdaemon.v2.Dfdaemon/ImportTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dfdaemonClient) ExportTask(ctx context.Context, in *ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/dfdaemon.v2.Dfdaemon/ExportTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *dfdaemonClient) DeleteTask(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/dfdaemon.v2.Dfdaemon/DeleteTask", in, out, opts...) @@ -130,12 +119,10 @@ type DfdaemonServer interface { SyncPieces(Dfdaemon_SyncPiecesServer) error // DownloadTask downloads task back-to-source. DownloadTask(context.Context, *DownloadTaskRequest) (*emptypb.Empty, error) + // UploadTask uploads task to p2p network. + UploadTask(context.Context, *UploadTaskRequest) (*emptypb.Empty, error) // StatTask stats task information. StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) - // ImportTask imports task to p2p network. - ImportTask(context.Context, *ImportTaskRequest) (*emptypb.Empty, error) - // ExportTask exports task from p2p network. - ExportTask(context.Context, *ExportTaskRequest) (*emptypb.Empty, error) // DeleteTask deletes task from p2p network. DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) } @@ -150,15 +137,12 @@ func (UnimplementedDfdaemonServer) SyncPieces(Dfdaemon_SyncPiecesServer) error { func (UnimplementedDfdaemonServer) DownloadTask(context.Context, *DownloadTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DownloadTask not implemented") } +func (UnimplementedDfdaemonServer) UploadTask(context.Context, *UploadTaskRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadTask not implemented") +} func (UnimplementedDfdaemonServer) StatTask(context.Context, *StatTaskRequest) (*v2.Task, error) { return nil, status.Errorf(codes.Unimplemented, "method StatTask not implemented") } -func (UnimplementedDfdaemonServer) ImportTask(context.Context, *ImportTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ImportTask not implemented") -} -func (UnimplementedDfdaemonServer) ExportTask(context.Context, *ExportTaskRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExportTask not implemented") -} func (UnimplementedDfdaemonServer) DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteTask not implemented") } @@ -218,6 +202,24 @@ func _Dfdaemon_DownloadTask_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Dfdaemon_UploadTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DfdaemonServer).UploadTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dfdaemon.v2.Dfdaemon/UploadTask", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DfdaemonServer).UploadTask(ctx, req.(*UploadTaskRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Dfdaemon_StatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatTaskRequest) if err := dec(in); err != nil { @@ -236,42 +238,6 @@ func _Dfdaemon_StatTask_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } -func _Dfdaemon_ImportTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DfdaemonServer).ImportTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dfdaemon.v2.Dfdaemon/ImportTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DfdaemonServer).ImportTask(ctx, req.(*ImportTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Dfdaemon_ExportTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExportTaskRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DfdaemonServer).ExportTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dfdaemon.v2.Dfdaemon/ExportTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DfdaemonServer).ExportTask(ctx, req.(*ExportTaskRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Dfdaemon_DeleteTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteTaskRequest) if err := dec(in); err != nil { @@ -301,18 +267,14 @@ var Dfdaemon_ServiceDesc = grpc.ServiceDesc{ MethodName: "DownloadTask", Handler: _Dfdaemon_DownloadTask_Handler, }, + { + MethodName: "UploadTask", + Handler: _Dfdaemon_UploadTask_Handler, + }, { MethodName: "StatTask", Handler: _Dfdaemon_StatTask_Handler, }, - { - MethodName: "ImportTask", - Handler: _Dfdaemon_ImportTask_Handler, - }, - { - MethodName: "ExportTask", - Handler: _Dfdaemon_ExportTask_Handler, - }, { MethodName: "DeleteTask", Handler: _Dfdaemon_DeleteTask_Handler, diff --git a/pkg/apis/dfdaemon/v2/mocks/dfdaemon_mock.go b/pkg/apis/dfdaemon/v2/mocks/dfdaemon_mock.go index cff85a0..2a9ab76 100644 --- a/pkg/apis/dfdaemon/v2/mocks/dfdaemon_mock.go +++ b/pkg/apis/dfdaemon/v2/mocks/dfdaemon_mock.go @@ -79,46 +79,6 @@ func (mr *MockDfdaemonClientMockRecorder) DownloadTask(ctx, in interface{}, opts return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadTask", reflect.TypeOf((*MockDfdaemonClient)(nil).DownloadTask), varargs...) } -// ExportTask mocks base method. -func (m *MockDfdaemonClient) ExportTask(ctx context.Context, in *dfdaemon.ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, in} - for _, a := range opts { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ExportTask", varargs...) - ret0, _ := ret[0].(*emptypb.Empty) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ExportTask indicates an expected call of ExportTask. -func (mr *MockDfdaemonClientMockRecorder) ExportTask(ctx, in interface{}, opts ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, in}, opts...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportTask", reflect.TypeOf((*MockDfdaemonClient)(nil).ExportTask), varargs...) -} - -// ImportTask mocks base method. -func (m *MockDfdaemonClient) ImportTask(ctx context.Context, in *dfdaemon.ImportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, in} - for _, a := range opts { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "ImportTask", varargs...) - ret0, _ := ret[0].(*emptypb.Empty) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImportTask indicates an expected call of ImportTask. -func (mr *MockDfdaemonClientMockRecorder) ImportTask(ctx, in interface{}, opts ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, in}, opts...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportTask", reflect.TypeOf((*MockDfdaemonClient)(nil).ImportTask), varargs...) -} - // StatTask mocks base method. func (m *MockDfdaemonClient) StatTask(ctx context.Context, in *dfdaemon.StatTaskRequest, opts ...grpc.CallOption) (*common.Task, error) { m.ctrl.T.Helper() @@ -159,6 +119,26 @@ func (mr *MockDfdaemonClientMockRecorder) SyncPieces(ctx interface{}, opts ...in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieces", reflect.TypeOf((*MockDfdaemonClient)(nil).SyncPieces), varargs...) } +// UploadTask mocks base method. +func (m *MockDfdaemonClient) UploadTask(ctx context.Context, in *dfdaemon.UploadTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UploadTask", varargs...) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UploadTask indicates an expected call of UploadTask. +func (mr *MockDfdaemonClientMockRecorder) UploadTask(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadTask", reflect.TypeOf((*MockDfdaemonClient)(nil).UploadTask), varargs...) +} + // MockDfdaemon_SyncPiecesClient is a mock of Dfdaemon_SyncPiecesClient interface. type MockDfdaemon_SyncPiecesClient struct { ctrl *gomock.Controller @@ -349,36 +329,6 @@ func (mr *MockDfdaemonServerMockRecorder) DownloadTask(arg0, arg1 interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadTask", reflect.TypeOf((*MockDfdaemonServer)(nil).DownloadTask), arg0, arg1) } -// ExportTask mocks base method. -func (m *MockDfdaemonServer) ExportTask(arg0 context.Context, arg1 *dfdaemon.ExportTaskRequest) (*emptypb.Empty, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExportTask", arg0, arg1) - ret0, _ := ret[0].(*emptypb.Empty) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ExportTask indicates an expected call of ExportTask. -func (mr *MockDfdaemonServerMockRecorder) ExportTask(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportTask", reflect.TypeOf((*MockDfdaemonServer)(nil).ExportTask), arg0, arg1) -} - -// ImportTask mocks base method. -func (m *MockDfdaemonServer) ImportTask(arg0 context.Context, arg1 *dfdaemon.ImportTaskRequest) (*emptypb.Empty, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ImportTask", arg0, arg1) - ret0, _ := ret[0].(*emptypb.Empty) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ImportTask indicates an expected call of ImportTask. -func (mr *MockDfdaemonServerMockRecorder) ImportTask(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImportTask", reflect.TypeOf((*MockDfdaemonServer)(nil).ImportTask), arg0, arg1) -} - // StatTask mocks base method. func (m *MockDfdaemonServer) StatTask(arg0 context.Context, arg1 *dfdaemon.StatTaskRequest) (*common.Task, error) { m.ctrl.T.Helper() @@ -408,6 +358,21 @@ func (mr *MockDfdaemonServerMockRecorder) SyncPieces(arg0 interface{}) *gomock.C return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncPieces", reflect.TypeOf((*MockDfdaemonServer)(nil).SyncPieces), arg0) } +// UploadTask mocks base method. +func (m *MockDfdaemonServer) UploadTask(arg0 context.Context, arg1 *dfdaemon.UploadTaskRequest) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UploadTask", arg0, arg1) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UploadTask indicates an expected call of UploadTask. +func (mr *MockDfdaemonServerMockRecorder) UploadTask(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadTask", reflect.TypeOf((*MockDfdaemonServer)(nil).UploadTask), arg0, arg1) +} + // MockUnsafeDfdaemonServer is a mock of UnsafeDfdaemonServer interface. type MockUnsafeDfdaemonServer struct { ctrl *gomock.Controller diff --git a/pkg/apis/errordetails/v2/errordetails.pb.go b/pkg/apis/errordetails/v2/errordetails.pb.go index 22aef70..6a930c0 100644 --- a/pkg/apis/errordetails/v2/errordetails.pb.go +++ b/pkg/apis/errordetails/v2/errordetails.pb.go @@ -95,7 +95,7 @@ type DownloadPieceBackToSourceFailed struct { // Temporary recoverable error of source. Temporary bool `protobuf:"varint,1,opt,name=temporary,proto3" json:"temporary,omitempty"` // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - Metadata *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + ExtendAttribute *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"` // The number of piece. PieceNumber uint32 `protobuf:"varint,3,opt,name=piece_number,json=pieceNumber,proto3" json:"piece_number,omitempty"` // The description of the error. @@ -141,9 +141,9 @@ func (x *DownloadPieceBackToSourceFailed) GetTemporary() bool { return false } -func (x *DownloadPieceBackToSourceFailed) GetMetadata() *v2.ExtendAttribute { +func (x *DownloadPieceBackToSourceFailed) GetExtendAttribute() *v2.ExtendAttribute { if x != nil { - return x.Metadata + return x.ExtendAttribute } return nil } @@ -171,7 +171,7 @@ type DownloadPieceFailed struct { // Temporary recoverable error of parent peer. Temporary bool `protobuf:"varint,1,opt,name=temporary,proto3" json:"temporary,omitempty"` // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - Metadata *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + ExtendAttribute *v2.ExtendAttribute `protobuf:"bytes,2,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"` // Piece is information of piece. ParentId string `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` // The number of piece. @@ -219,9 +219,9 @@ func (x *DownloadPieceFailed) GetTemporary() bool { return false } -func (x *DownloadPieceFailed) GetMetadata() *v2.ExtendAttribute { +func (x *DownloadPieceFailed) GetExtendAttribute() *v2.ExtendAttribute { if x != nil { - return x.Metadata + return x.ExtendAttribute } return nil } @@ -412,55 +412,6 @@ func (x *SyncPiecesFailed) GetDescription() string { return "" } -// StatMetadataFailed is error detail of stat metadata. -type StatMetadataFailed struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The description of the error. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *StatMetadataFailed) Reset() { - *x = StatMetadataFailed{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatMetadataFailed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatMetadataFailed) ProtoMessage() {} - -func (x *StatMetadataFailed) ProtoReflect() protoreflect.Message { - mi := &file_pkg_apis_errordetails_v2_errordetails_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 StatMetadataFailed.ProtoReflect.Descriptor instead. -func (*StatMetadataFailed) Descriptor() ([]byte, []int) { - return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP(), []int{6} -} - -func (x *StatMetadataFailed) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - var File_pkg_apis_errordetails_v2_errordetails_proto protoreflect.FileDescriptor var file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc = []byte{ @@ -475,57 +426,56 @@ var file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x65, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xcf, 0x01, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, 0x0a, 0x1f, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x40, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x2a, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, - 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xe9, - 0x01, 0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, - 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, - 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, - 0x72, 0x61, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x0c, - 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x0b, 0x70, 0x69, 0x65, - 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x0a, 0x15, 0x53, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x12, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x50, 0x65, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, - 0x10, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, - 0x24, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x32, 0x5a, 0x30, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x4f, + 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, + 0x2a, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x0b, + 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf8, 0x01, + 0x0a, 0x13, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x69, 0x65, 0x63, 0x65, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, + 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, + 0x61, 0x72, 0x79, 0x12, 0x4f, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x0c, 0x70, 0x69, + 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x00, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x39, 0x0a, 0x15, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x50, 0x65, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x36, 0x0a, 0x12, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, + 0x65, 0x65, 0x72, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a, 0x10, 0x53, + 0x79, 0x6e, 0x63, 0x50, 0x69, 0x65, 0x63, 0x65, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x12, 0x24, 0x0a, + 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x32, 0x5a, 0x30, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -540,7 +490,7 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_rawDescGZIP() []byte { return file_pkg_apis_errordetails_v2_errordetails_proto_rawDescData } -var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_pkg_apis_errordetails_v2_errordetails_proto_goTypes = []interface{}{ (*DownloadPeerBackToSourceFailed)(nil), // 0: errordetails.v2.DownloadPeerBackToSourceFailed (*DownloadPieceBackToSourceFailed)(nil), // 1: errordetails.v2.DownloadPieceBackToSourceFailed @@ -548,12 +498,11 @@ var file_pkg_apis_errordetails_v2_errordetails_proto_goTypes = []interface{}{ (*SchedulePeerForbidden)(nil), // 3: errordetails.v2.SchedulePeerForbidden (*SchedulePeerFailed)(nil), // 4: errordetails.v2.SchedulePeerFailed (*SyncPiecesFailed)(nil), // 5: errordetails.v2.SyncPiecesFailed - (*StatMetadataFailed)(nil), // 6: errordetails.v2.StatMetadataFailed - (*v2.ExtendAttribute)(nil), // 7: common.v2.ExtendAttribute + (*v2.ExtendAttribute)(nil), // 6: common.v2.ExtendAttribute } var file_pkg_apis_errordetails_v2_errordetails_proto_depIdxs = []int32{ - 7, // 0: errordetails.v2.DownloadPieceBackToSourceFailed.metadata:type_name -> common.v2.ExtendAttribute - 7, // 1: errordetails.v2.DownloadPieceFailed.metadata:type_name -> common.v2.ExtendAttribute + 6, // 0: errordetails.v2.DownloadPieceBackToSourceFailed.extend_attribute:type_name -> common.v2.ExtendAttribute + 6, // 1: errordetails.v2.DownloadPieceFailed.extend_attribute:type_name -> common.v2.ExtendAttribute 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -639,18 +588,6 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() { return nil } } - file_pkg_apis_errordetails_v2_errordetails_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatMetadataFailed); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -658,7 +595,7 @@ func file_pkg_apis_errordetails_v2_errordetails_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_apis_errordetails_v2_errordetails_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/apis/errordetails/v2/errordetails.pb.validate.go b/pkg/apis/errordetails/v2/errordetails.pb.validate.go index 9866554..6ba3f95 100644 --- a/pkg/apis/errordetails/v2/errordetails.pb.validate.go +++ b/pkg/apis/errordetails/v2/errordetails.pb.validate.go @@ -164,9 +164,9 @@ func (m *DownloadPieceBackToSourceFailed) validate(all bool) error { // no validation rules for Temporary - if m.GetMetadata() == nil { + if m.GetExtendAttribute() == nil { err := DownloadPieceBackToSourceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "value is required", } if !all { @@ -176,11 +176,11 @@ func (m *DownloadPieceBackToSourceFailed) validate(all bool) error { } if all { - switch v := interface{}(m.GetMetadata()).(type) { + switch v := interface{}(m.GetExtendAttribute()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, DownloadPieceBackToSourceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, }) @@ -188,16 +188,16 @@ func (m *DownloadPieceBackToSourceFailed) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, DownloadPieceBackToSourceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExtendAttribute()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DownloadPieceBackToSourceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, } @@ -322,9 +322,9 @@ func (m *DownloadPieceFailed) validate(all bool) error { // no validation rules for Temporary - if m.GetMetadata() == nil { + if m.GetExtendAttribute() == nil { err := DownloadPieceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "value is required", } if !all { @@ -334,11 +334,11 @@ func (m *DownloadPieceFailed) validate(all bool) error { } if all { - switch v := interface{}(m.GetMetadata()).(type) { + switch v := interface{}(m.GetExtendAttribute()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, DownloadPieceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, }) @@ -346,16 +346,16 @@ func (m *DownloadPieceFailed) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, DownloadPieceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExtendAttribute()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DownloadPieceFailedValidationError{ - field: "Metadata", + field: "ExtendAttribute", reason: "embedded message failed validation", cause: err, } @@ -788,107 +788,3 @@ var _ interface { Cause() error ErrorName() string } = SyncPiecesFailedValidationError{} - -// Validate checks the field values on StatMetadataFailed 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 *StatMetadataFailed) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on StatMetadataFailed 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 -// StatMetadataFailedMultiError, or nil if none found. -func (m *StatMetadataFailed) ValidateAll() error { - return m.validate(true) -} - -func (m *StatMetadataFailed) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Description - - if len(errors) > 0 { - return StatMetadataFailedMultiError(errors) - } - - return nil -} - -// StatMetadataFailedMultiError is an error wrapping multiple validation errors -// returned by StatMetadataFailed.ValidateAll() if the designated constraints -// aren't met. -type StatMetadataFailedMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m StatMetadataFailedMultiError) 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 StatMetadataFailedMultiError) AllErrors() []error { return m } - -// StatMetadataFailedValidationError is the validation error returned by -// StatMetadataFailed.Validate if the designated constraints aren't met. -type StatMetadataFailedValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e StatMetadataFailedValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e StatMetadataFailedValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e StatMetadataFailedValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e StatMetadataFailedValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e StatMetadataFailedValidationError) ErrorName() string { - return "StatMetadataFailedValidationError" -} - -// Error satisfies the builtin error interface -func (e StatMetadataFailedValidationError) 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 %sStatMetadataFailed.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = StatMetadataFailedValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = StatMetadataFailedValidationError{} diff --git a/pkg/apis/errordetails/v2/errordetails.proto b/pkg/apis/errordetails/v2/errordetails.proto index 5cdedfd..5ba7cfa 100644 --- a/pkg/apis/errordetails/v2/errordetails.proto +++ b/pkg/apis/errordetails/v2/errordetails.proto @@ -34,7 +34,7 @@ message DownloadPieceBackToSourceFailed { // Temporary recoverable error of source. bool temporary = 1; // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - common.v2.ExtendAttribute metadata = 2 [(validate.rules).message.required = true]; + common.v2.ExtendAttribute extend_attribute = 2 [(validate.rules).message.required = true]; // The number of piece. uint32 piece_number = 3 [(validate.rules).uint32.gte = 0]; // The description of the error. @@ -46,7 +46,7 @@ message DownloadPieceFailed { // Temporary recoverable error of parent peer. bool temporary = 1; // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - common.v2.ExtendAttribute metadata = 2 [(validate.rules).message.required = true]; + common.v2.ExtendAttribute extend_attribute = 2 [(validate.rules).message.required = true]; // Piece is information of piece. string parent_id = 3 [(validate.rules).string.min_len = 1]; // The number of piece. @@ -76,9 +76,3 @@ message SyncPiecesFailed { // The description of the error. string description = 3; } - -// StatMetadataFailed is error detail of stat metadata. -message StatMetadataFailed { - // The description of the error. - string description = 1; -} diff --git a/pkg/apis/scheduler/v2/scheduler.pb.go b/pkg/apis/scheduler/v2/scheduler.pb.go index 40bdf7b..1b290fc 100644 --- a/pkg/apis/scheduler/v2/scheduler.pb.go +++ b/pkg/apis/scheduler/v2/scheduler.pb.go @@ -47,8 +47,8 @@ type RegisterPeerRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Task metadata. - Metadata *v2.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Download information. + Download *v2.Download `protobuf:"bytes,1,opt,name=download,proto3" json:"download,omitempty"` } func (x *RegisterPeerRequest) Reset() { @@ -83,9 +83,9 @@ func (*RegisterPeerRequest) Descriptor() ([]byte, []int) { return file_pkg_apis_scheduler_v2_scheduler_proto_rawDescGZIP(), []int{0} } -func (x *RegisterPeerRequest) GetMetadata() *v2.Metadata { +func (x *RegisterPeerRequest) GetDownload() *v2.Download { if x != nil { - return x.Metadata + return x.Download } return nil } @@ -2503,10 +2503,10 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_rawDesc = []byte{ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x74, 0x12, 0x39, 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1c, 0x0a, 0x1a, + 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, 0x1c, 0x0a, 0x1a, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x26, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x65, 0x65, 0x72, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, @@ -3009,7 +3009,7 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_goTypes = []interface{}{ (*UpdateHostsRequest)(nil), // 30: scheduler.v2.UpdateHostsRequest (*DeleteHostsRequest)(nil), // 31: scheduler.v2.DeleteHostsRequest (*SyncNetworkTopologyRequest)(nil), // 32: scheduler.v2.SyncNetworkTopologyRequest - (*v2.Metadata)(nil), // 33: common.v2.Metadata + (*v2.Download)(nil), // 33: common.v2.Download (*v2.Piece)(nil), // 34: common.v2.Piece (*v21.DownloadPeerBackToSourceFailed)(nil), // 35: errordetails.v2.DownloadPeerBackToSourceFailed (*v21.DownloadPieceBackToSourceFailed)(nil), // 36: errordetails.v2.DownloadPieceBackToSourceFailed @@ -3025,7 +3025,7 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_goTypes = []interface{}{ (*v2.Task)(nil), // 46: common.v2.Task } var file_pkg_apis_scheduler_v2_scheduler_proto_depIdxs = []int32{ - 33, // 0: scheduler.v2.RegisterPeerRequest.metadata:type_name -> common.v2.Metadata + 33, // 0: scheduler.v2.RegisterPeerRequest.download:type_name -> common.v2.Download 34, // 1: scheduler.v2.DownloadPieceFinishedRequest.piece:type_name -> common.v2.Piece 34, // 2: scheduler.v2.DownloadPieceBackToSourceFinishedRequest.piece:type_name -> common.v2.Piece 0, // 3: scheduler.v2.AnnouncePeerRequest.register_peer_request:type_name -> scheduler.v2.RegisterPeerRequest diff --git a/pkg/apis/scheduler/v2/scheduler.pb.validate.go b/pkg/apis/scheduler/v2/scheduler.pb.validate.go index e692f74..1bac4a4 100644 --- a/pkg/apis/scheduler/v2/scheduler.pb.validate.go +++ b/pkg/apis/scheduler/v2/scheduler.pb.validate.go @@ -57,9 +57,9 @@ func (m *RegisterPeerRequest) validate(all bool) error { var errors []error - if m.GetMetadata() == nil { + if m.GetDownload() == nil { err := RegisterPeerRequestValidationError{ - field: "Metadata", + field: "Download", reason: "value is required", } if !all { @@ -69,11 +69,11 @@ func (m *RegisterPeerRequest) validate(all bool) error { } if all { - switch v := interface{}(m.GetMetadata()).(type) { + switch v := interface{}(m.GetDownload()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, RegisterPeerRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, }) @@ -81,16 +81,16 @@ func (m *RegisterPeerRequest) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, RegisterPeerRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetDownload()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RegisterPeerRequestValidationError{ - field: "Metadata", + field: "Download", reason: "embedded message failed validation", cause: err, } diff --git a/pkg/apis/scheduler/v2/scheduler.proto b/pkg/apis/scheduler/v2/scheduler.proto index 305d19a..164487f 100644 --- a/pkg/apis/scheduler/v2/scheduler.proto +++ b/pkg/apis/scheduler/v2/scheduler.proto @@ -29,8 +29,8 @@ option go_package = "d7y.io/api/pkg/apis/scheduler/v2;scheduler"; // RegisterPeerRequest represents peer registered request of AnnouncePeerRequest. message RegisterPeerRequest { - // Task metadata. - common.v2.Metadata metadata = 1 [(validate.rules).message.required = true]; + // Download information. + common.v2.Download download = 1 [(validate.rules).message.required = true]; } // DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest. diff --git a/proto/common.proto b/proto/common.proto index a316189..8fdd5ab 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -104,44 +104,66 @@ enum Priority { message Peer { // Peer id. string id = 1; + // Range is url range of request. + Range range = 2; + // Peer priority. + Priority priority = 3; // Pieces of peer. - repeated Piece pieces = 2; - // Task info. - Task task = 3; - // Host info. - Host host = 4; + repeated Piece pieces = 4; + // Peer downloads costs time. + google.protobuf.Duration cost = 5; // Peer state. - string state = 5; + string state = 6; + // Task info. + Task task = 7; + // Host info. + Host host = 8; + // NeedBackToSource needs downloaded from source. + bool need_back_to_source = 9; // Peer create time. - google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp created_at = 10; // Peer update time. - google.protobuf.Timestamp updated_at = 7; + google.protobuf.Timestamp updated_at = 11; } // Task metadata. message Task { // Task id. string id = 1; - // Host type. + // Task type. string type = 2; - // Task size scope. - SizeScope size_scope = 3; - // Pieces of task. - repeated Piece pieces = 4; - // Task state. - string state = 5; - // Task metadata. - Metadata metadata = 6; + // Download url. + string url = 3; + // Digest of the pieces digest, for example md5:xxx or sha256:yyy. + string digest = 4; + // URL tag identifies different task for same url. + string tag = 5; + // Application of task. + string application = 6; + // Filter url used to generate task id. + repeated string filters = 7; + // Task request headers. + map header = 8; + // Task piece size. + int32 piece_size = 9; // Task content length. - int64 content_length = 7; + int64 content_length = 10; + // Task piece count. + int64 piece_count = 11; + // Task size scope. + SizeScope size_scope = 12; + // Pieces of task. + repeated Piece pieces = 13; + // Task state. + string state = 14; // Task peer count. - int32 peer_count = 8; + int32 peer_count = 15; // Task contains available peer. - bool hasAvailablePeer = 9; + bool hasAvailablePeer = 16; // Task create time. - google.protobuf.Timestamp created_at = 10; + google.protobuf.Timestamp created_at = 17; // Task update time. - google.protobuf.Timestamp updated_at = 11; + google.protobuf.Timestamp updated_at = 18; } // Host metadata. @@ -158,8 +180,8 @@ message Host { int32 download_port = 5; // Security domain for network. string security_domain = 6; - // Host location(area, country, province, city, etc.). - repeated string location = 7; + // Host location, eg: area|country|province|city. + string location = 7; // IDC where the peer host is located. string idc = 8; } @@ -172,8 +194,8 @@ message Range { uint64 end = 2; } -// Metadata represents metadata of task. -message Metadata { +// Download information. +message Download { // Download url. string url = 1; // Digest of the pieces digest, for example md5:xxx or sha256:yyy. @@ -181,7 +203,7 @@ message Metadata { // Range is url range of request. Range range = 3; // Task type. - common.TaskType type = 4; + TaskType type = 4; // URL tag identifies different task for same url. string tag = 5; // Application of task. @@ -194,19 +216,27 @@ message Metadata { map header = 9; // Task piece size. int32 piece_size = 10; + // File path to be exported. + string output_path = 11; + // Download timeout. + google.protobuf.Duration timeout = 12; + // Download rate limit in bytes per second. + double download_rate_limit = 13; + // NeedBackToSource needs downloaded from source. + bool need_back_to_source = 14; } // Piece represents information of piece. message Piece { // Piece number. uint32 number = 1; - // Parent peer id. + // Parent peer id. string parent_id = 2; - // Piece offset. + // Piece offset. uint64 offset = 3; - // Piece size. + // Piece size. uint64 size = 4; - // Digest of the piece data, for example md5:xxx or sha256:yyy. + // Digest of the piece data, for example md5:xxx or sha256:yyy. string digest = 5; // Traffic type. TrafficType traffic_type = 6; diff --git a/proto/dfdaemon.proto b/proto/dfdaemon.proto index 3fa46fb..1213bce 100644 --- a/proto/dfdaemon.proto +++ b/proto/dfdaemon.proto @@ -20,7 +20,6 @@ package dfdaemon; import "common.proto"; import "errordetails.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; // InterestedAllPiecesRequest represents interested all pieces request of SyncPiecesRequest. @@ -33,16 +32,11 @@ message InterestedPiecesRequest { repeated uint32 piece_numbers = 1; } -// StatMetadata represents stat metadata request of SyncPiecesRequest. -message StatMetadataRequest { -} - // SyncPiecesRequest represents request of AnnouncePeer. message SyncPiecesRequest{ oneof request { InterestedAllPiecesRequest interested_all_pieces_request = 1; InterestedPiecesRequest interested_pieces_request = 2; - StatMetadataRequest stat_metadata_request = 3; } } @@ -52,31 +46,27 @@ message InterestedPiecesResponse { repeated common.Piece pieces = 1; } -// StatMetadata represents stat metadata request of SyncPiecesResponse. -message StatMetadataResponse { - // Task metadata. - common.Metadata metadata = 1; -} - // SyncPiecesResponse represents response of SyncPieces. message SyncPiecesResponse { oneof response { InterestedPiecesResponse interested_pieces_response = 1; - StatMetadataResponse stat_metadata_response = 2; } oneof errordetails { errordetails.SyncPiecesFailed sync_pieces_failed = 3; - errordetails.StatMetadataFailed stat_metadata_failed = 4; } } // DownloadTaskRequest represents request of DownloadTask. message DownloadTaskRequest { - // Task id. - string task_id = 1; + // Download information. + common.Download download = 1; +} + +// UploadTaskRequest represents request of UploadTask. +message UploadTaskRequest { // Task metadata. - common.Metadata metadata = 2; + common.Task task = 1; } // StatTaskRequest represents request of StatTask. @@ -87,33 +77,10 @@ message StatTaskRequest { // StatTaskResponse represents response of StatTask. message StatTaskResponse { + // Task metadata. common.Task task = 1; } -// ImportTaskRequest represents request of ImportTask. -message ImportTaskRequest { - // Task metadata. - common.Metadata metadata = 1; - // File path to be imported. - string path = 2; -} - -// ExportTaskRequest represents request of ExportTask. -message ExportTaskRequest { - // Task metadata. - common.Metadata metadata = 1; - // File path to be exported. - string path = 2; - // Download timeout. - google.protobuf.Duration timeout = 3; - // Download rate limit in bytes per second. - double download_rate_limit = 4; - // User id. - uint64 uid = 5; - // Group id. - uint64 gid = 6; -} - // DeleteTaskRequest represents request of DeleteTask. message DeleteTaskRequest { // Task id. @@ -128,15 +95,12 @@ service Dfdaemon{ // DownloadTask downloads task back-to-source. rpc DownloadTask(DownloadTaskRequest) returns(google.protobuf.Empty); + // UploadTask uploads task to p2p network. + rpc UploadTask(UploadTaskRequest) returns(google.protobuf.Empty); + // StatTask stats task information. rpc StatTask(StatTaskRequest) returns(common.Task); - // ImportTask imports task to p2p network. - rpc ImportTask(ImportTaskRequest) returns(google.protobuf.Empty); - - // ExportTask exports task from p2p network. - rpc ExportTask(ExportTaskRequest) returns(google.protobuf.Empty); - // DeleteTask deletes task from p2p network. rpc DeleteTask(DeleteTaskRequest) returns(google.protobuf.Empty); } diff --git a/proto/errordetails.proto b/proto/errordetails.proto index 21c390a..4fe0829 100644 --- a/proto/errordetails.proto +++ b/proto/errordetails.proto @@ -31,7 +31,7 @@ message DownloadPieceBackToSourceFailed { // Temporary recoverable error of source. bool temporary = 1; // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - common.ExtendAttribute metadata = 2; + common.ExtendAttribute extend_attribute = 2; // The number of piece. uint32 piece_number = 3; // The description of the error. @@ -43,7 +43,7 @@ message DownloadPieceFailed { // Temporary recoverable error of parent peer. bool temporary = 1; // Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header - common.ExtendAttribute metadata = 2; + common.ExtendAttribute extend_attribute = 2; // Piece is information of piece. string parent_id = 3; // The number of piece. @@ -73,9 +73,3 @@ message SyncPiecesFailed { // The description of the error. string description = 3; } - -// StatMetadataFailed is error detail of stat metadata. -message StatMetadataFailed { - // The description of the error. - string description = 1; -} diff --git a/proto/scheduler.proto b/proto/scheduler.proto index 13884b3..614565b 100644 --- a/proto/scheduler.proto +++ b/proto/scheduler.proto @@ -26,8 +26,8 @@ import "google/protobuf/timestamp.proto"; // RegisterPeerRequest represents peer registered request of AnnouncePeerRequest. message RegisterPeerRequest { - // Task metadata. - common.Metadata metadata = 1; + // Download information. + common.Download download = 1; } // DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest. diff --git a/src/common.rs b/src/common.rs index d277edf..275b33e 100644 --- a/src/common.rs +++ b/src/common.rs @@ -5,23 +5,35 @@ pub struct Peer { /// Peer id. #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, + /// Range is url range of request. + #[prost(message, optional, tag = "2")] + pub range: ::core::option::Option, + /// Peer priority. + #[prost(enumeration = "Priority", tag = "3")] + pub priority: i32, /// Pieces of peer. - #[prost(message, repeated, tag = "2")] + #[prost(message, repeated, tag = "4")] pub pieces: ::prost::alloc::vec::Vec, + /// Peer downloads costs time. + #[prost(message, optional, tag = "5")] + pub cost: ::core::option::Option<::prost_types::Duration>, + /// Peer state. + #[prost(string, tag = "6")] + pub state: ::prost::alloc::string::String, /// Task info. - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "7")] pub task: ::core::option::Option, /// Host info. - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag = "8")] pub host: ::core::option::Option, - /// Peer state. - #[prost(string, tag = "5")] - pub state: ::prost::alloc::string::String, + /// NeedBackToSource needs downloaded from source. + #[prost(bool, tag = "9")] + pub need_back_to_source: bool, /// Peer create time. - #[prost(message, optional, tag = "6")] + #[prost(message, optional, tag = "10")] pub created_at: ::core::option::Option<::prost_types::Timestamp>, /// Peer update time. - #[prost(message, optional, tag = "7")] + #[prost(message, optional, tag = "11")] pub updated_at: ::core::option::Option<::prost_types::Timestamp>, } /// Task metadata. @@ -31,35 +43,59 @@ pub struct Task { /// Task id. #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, - /// Host type. + /// Task type. #[prost(string, tag = "2")] pub r#type: ::prost::alloc::string::String, + /// Download url. + #[prost(string, tag = "3")] + pub url: ::prost::alloc::string::String, + /// Digest of the pieces digest, for example md5:xxx or sha256:yyy. + #[prost(string, tag = "4")] + pub digest: ::prost::alloc::string::String, + /// URL tag identifies different task for same url. + #[prost(string, tag = "5")] + pub tag: ::prost::alloc::string::String, + /// Application of task. + #[prost(string, tag = "6")] + pub application: ::prost::alloc::string::String, + /// Filter url used to generate task id. + #[prost(string, repeated, tag = "7")] + pub filters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Task request headers. + #[prost(map = "string, string", tag = "8")] + pub header: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + /// Task piece size. + #[prost(int32, tag = "9")] + pub piece_size: i32, + /// Task content length. + #[prost(int64, tag = "10")] + pub content_length: i64, + /// Task piece count. + #[prost(int64, tag = "11")] + pub piece_count: i64, /// Task size scope. - #[prost(enumeration = "SizeScope", tag = "3")] + #[prost(enumeration = "SizeScope", tag = "12")] pub size_scope: i32, /// Pieces of task. - #[prost(message, repeated, tag = "4")] + #[prost(message, repeated, tag = "13")] pub pieces: ::prost::alloc::vec::Vec, /// Task state. - #[prost(string, tag = "5")] + #[prost(string, tag = "14")] pub state: ::prost::alloc::string::String, - /// Task metadata. - #[prost(message, optional, tag = "6")] - pub metadata: ::core::option::Option, - /// Task content length. - #[prost(int64, tag = "7")] - pub content_length: i64, /// Task peer count. - #[prost(int32, tag = "8")] + #[prost(int32, tag = "15")] pub peer_count: i32, /// Task contains available peer. - #[prost(bool, tag = "9")] + #[prost(bool, tag = "16")] pub has_available_peer: bool, /// Task create time. - #[prost(message, optional, tag = "10")] + #[prost(message, optional, tag = "17")] pub created_at: ::core::option::Option<::prost_types::Timestamp>, /// Task update time. - #[prost(message, optional, tag = "11")] + #[prost(message, optional, tag = "18")] pub updated_at: ::core::option::Option<::prost_types::Timestamp>, } /// Host metadata. @@ -84,9 +120,9 @@ pub struct Host { /// Security domain for network. #[prost(string, tag = "6")] pub security_domain: ::prost::alloc::string::String, - /// Host location(area, country, province, city, etc.). - #[prost(string, repeated, tag = "7")] - pub location: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Host location, eg: area|country|province|city. + #[prost(string, tag = "7")] + pub location: ::prost::alloc::string::String, /// IDC where the peer host is located. #[prost(string, tag = "8")] pub idc: ::prost::alloc::string::String, @@ -102,10 +138,10 @@ pub struct Range { #[prost(uint64, tag = "2")] pub end: u64, } -/// Metadata represents metadata of task. +/// Download information. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { +pub struct Download { /// Download url. #[prost(string, tag = "1")] pub url: ::prost::alloc::string::String, @@ -139,6 +175,18 @@ pub struct Metadata { /// Task piece size. #[prost(int32, tag = "10")] pub piece_size: i32, + /// File path to be exported. + #[prost(string, tag = "11")] + pub output_path: ::prost::alloc::string::String, + /// Download timeout. + #[prost(message, optional, tag = "12")] + pub timeout: ::core::option::Option<::prost_types::Duration>, + /// Download rate limit in bytes per second. + #[prost(double, tag = "13")] + pub download_rate_limit: f64, + /// NeedBackToSource needs downloaded from source. + #[prost(bool, tag = "14")] + pub need_back_to_source: bool, } /// Piece represents information of piece. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/dfdaemon.rs b/src/dfdaemon.rs index 776b7e3..119e035 100644 --- a/src/dfdaemon.rs +++ b/src/dfdaemon.rs @@ -10,15 +10,11 @@ pub struct InterestedPiecesRequest { #[prost(uint32, repeated, tag = "1")] pub piece_numbers: ::prost::alloc::vec::Vec, } -/// StatMetadata represents stat metadata request of SyncPiecesRequest. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatMetadataRequest {} /// SyncPiecesRequest represents request of AnnouncePeer. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SyncPiecesRequest { - #[prost(oneof = "sync_pieces_request::Request", tags = "1, 2, 3")] + #[prost(oneof = "sync_pieces_request::Request", tags = "1, 2")] pub request: ::core::option::Option, } /// Nested message and enum types in `SyncPiecesRequest`. @@ -30,8 +26,6 @@ pub mod sync_pieces_request { InterestedAllPiecesRequest(super::InterestedAllPiecesRequest), #[prost(message, tag = "2")] InterestedPiecesRequest(super::InterestedPiecesRequest), - #[prost(message, tag = "3")] - StatMetadataRequest(super::StatMetadataRequest), } } /// InterestedPiecesResponse represents interested pieces response of SyncPiecesResponse. @@ -42,21 +36,13 @@ pub struct InterestedPiecesResponse { #[prost(message, repeated, tag = "1")] pub pieces: ::prost::alloc::vec::Vec, } -/// StatMetadata represents stat metadata request of SyncPiecesResponse. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatMetadataResponse { - /// Task metadata. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, -} /// SyncPiecesResponse represents response of SyncPieces. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SyncPiecesResponse { - #[prost(oneof = "sync_pieces_response::Response", tags = "1, 2")] + #[prost(oneof = "sync_pieces_response::Response", tags = "1")] pub response: ::core::option::Option, - #[prost(oneof = "sync_pieces_response::Errordetails", tags = "3, 4")] + #[prost(oneof = "sync_pieces_response::Errordetails", tags = "3")] pub errordetails: ::core::option::Option, } /// Nested message and enum types in `SyncPiecesResponse`. @@ -66,28 +52,29 @@ pub mod sync_pieces_response { pub enum Response { #[prost(message, tag = "1")] InterestedPiecesResponse(super::InterestedPiecesResponse), - #[prost(message, tag = "2")] - StatMetadataResponse(super::StatMetadataResponse), } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Errordetails { #[prost(message, tag = "3")] SyncPiecesFailed(super::super::errordetails::SyncPiecesFailed), - #[prost(message, tag = "4")] - StatMetadataFailed(super::super::errordetails::StatMetadataFailed), } } /// DownloadTaskRequest represents request of DownloadTask. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DownloadTaskRequest { - /// Task id. - #[prost(string, tag = "1")] - pub task_id: ::prost::alloc::string::String, + /// Download information. + #[prost(message, optional, tag = "1")] + pub download: ::core::option::Option, +} +/// UploadTaskRequest represents request of UploadTask. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UploadTaskRequest { /// Task metadata. - #[prost(message, optional, tag = "2")] - pub metadata: ::core::option::Option, + #[prost(message, optional, tag = "1")] + pub task: ::core::option::Option, } /// StatTaskRequest represents request of StatTask. #[allow(clippy::derive_partial_eq_without_eq)] @@ -101,43 +88,10 @@ pub struct StatTaskRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatTaskResponse { + /// Task metadata. #[prost(message, optional, tag = "1")] pub task: ::core::option::Option, } -/// ImportTaskRequest represents request of ImportTask. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ImportTaskRequest { - /// Task metadata. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, - /// File path to be imported. - #[prost(string, tag = "2")] - pub path: ::prost::alloc::string::String, -} -/// ExportTaskRequest represents request of ExportTask. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExportTaskRequest { - /// Task metadata. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, - /// File path to be exported. - #[prost(string, tag = "2")] - pub path: ::prost::alloc::string::String, - /// Download timeout. - #[prost(message, optional, tag = "3")] - pub timeout: ::core::option::Option<::prost_types::Duration>, - /// Download rate limit in bytes per second. - #[prost(double, tag = "4")] - pub download_rate_limit: f64, - /// User id. - #[prost(uint64, tag = "5")] - pub uid: u64, - /// Group id. - #[prost(uint64, tag = "6")] - pub gid: u64, -} /// DeleteTaskRequest represents request of DeleteTask. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -259,6 +213,26 @@ pub mod dfdaemon_client { ); self.inner.unary(request.into_request(), path, codec).await } + /// UploadTask uploads task to p2p network. + pub async fn upload_task( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/dfdaemon.Dfdaemon/UploadTask", + ); + self.inner.unary(request.into_request(), path, codec).await + } /// StatTask stats task information. pub async fn stat_task( &mut self, @@ -279,46 +253,6 @@ pub mod dfdaemon_client { ); self.inner.unary(request.into_request(), path, codec).await } - /// ImportTask imports task to p2p network. - pub async fn import_task( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/dfdaemon.Dfdaemon/ImportTask", - ); - self.inner.unary(request.into_request(), path, codec).await - } - /// ExportTask exports task from p2p network. - pub async fn export_task( - &mut self, - request: impl tonic::IntoRequest, - ) -> Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/dfdaemon.Dfdaemon/ExportTask", - ); - self.inner.unary(request.into_request(), path, codec).await - } /// DeleteTask deletes task from p2p network. pub async fn delete_task( &mut self, @@ -364,21 +298,16 @@ pub mod dfdaemon_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + /// UploadTask uploads task to p2p network. + async fn upload_task( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; /// StatTask stats task information. async fn stat_task( &self, request: tonic::Request, ) -> Result, tonic::Status>; - /// ImportTask imports task to p2p network. - async fn import_task( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; - /// ExportTask exports task from p2p network. - async fn export_task( - &self, - request: tonic::Request, - ) -> Result, tonic::Status>; /// DeleteTask deletes task from p2p network. async fn delete_task( &self, @@ -526,6 +455,44 @@ pub mod dfdaemon_server { }; Box::pin(fut) } + "/dfdaemon.Dfdaemon/UploadTask" => { + #[allow(non_camel_case_types)] + struct UploadTaskSvc(pub Arc); + impl< + T: Dfdaemon, + > tonic::server::UnaryService + for UploadTaskSvc { + type Response = (); + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).upload_task(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UploadTaskSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/dfdaemon.Dfdaemon/StatTask" => { #[allow(non_camel_case_types)] struct StatTaskSvc(pub Arc); @@ -562,82 +529,6 @@ pub mod dfdaemon_server { }; Box::pin(fut) } - "/dfdaemon.Dfdaemon/ImportTask" => { - #[allow(non_camel_case_types)] - struct ImportTaskSvc(pub Arc); - impl< - T: Dfdaemon, - > tonic::server::UnaryService - for ImportTaskSvc { - type Response = (); - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).import_task(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ImportTaskSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/dfdaemon.Dfdaemon/ExportTask" => { - #[allow(non_camel_case_types)] - struct ExportTaskSvc(pub Arc); - impl< - T: Dfdaemon, - > tonic::server::UnaryService - for ExportTaskSvc { - type Response = (); - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = self.0.clone(); - let fut = async move { (*inner).export_task(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ExportTaskSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } "/dfdaemon.Dfdaemon/DeleteTask" => { #[allow(non_camel_case_types)] struct DeleteTaskSvc(pub Arc); diff --git a/src/errordetails.rs b/src/errordetails.rs index cbc98c6..5c38bf1 100644 --- a/src/errordetails.rs +++ b/src/errordetails.rs @@ -15,7 +15,7 @@ pub struct DownloadPieceBackToSourceFailed { pub temporary: bool, /// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header #[prost(message, optional, tag = "2")] - pub metadata: ::core::option::Option, + pub extend_attribute: ::core::option::Option, /// The number of piece. #[prost(uint32, tag = "3")] pub piece_number: u32, @@ -32,7 +32,7 @@ pub struct DownloadPieceFailed { pub temporary: bool, /// Source response metadata, eg: HTTP Status Code, HTTP Status, HTTP Header #[prost(message, optional, tag = "2")] - pub metadata: ::core::option::Option, + pub extend_attribute: ::core::option::Option, /// Piece is information of piece. #[prost(string, tag = "3")] pub parent_id: ::prost::alloc::string::String, @@ -73,11 +73,3 @@ pub struct SyncPiecesFailed { #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, } -/// StatMetadataFailed is error detail of stat metadata. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatMetadataFailed { - /// The description of the error. - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, -} diff --git a/src/scheduler.rs b/src/scheduler.rs index 776c58b..00821e6 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -2,9 +2,9 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisterPeerRequest { - /// Task metadata. + /// Download information. #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, + pub download: ::core::option::Option, } /// DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest. #[allow(clippy::derive_partial_eq_without_eq)]