mirror of https://github.com/dragonflyoss/api.git
refactor: download metadata in common (#66)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
b2e4c03aac
commit
602aa22af8
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<string, string> 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<string, string> 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.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<string, string> 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,6 +216,14 @@ message Metadata {
|
|||
map<string, string> 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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
102
src/common.rs
102
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<Range>,
|
||||
/// 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<Piece>,
|
||||
/// 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<Task>,
|
||||
/// Host info.
|
||||
#[prost(message, optional, tag = "4")]
|
||||
#[prost(message, optional, tag = "8")]
|
||||
pub host: ::core::option::Option<Host>,
|
||||
/// 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<Piece>,
|
||||
/// 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<Metadata>,
|
||||
/// 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)]
|
||||
|
|
263
src/dfdaemon.rs
263
src/dfdaemon.rs
|
@ -10,15 +10,11 @@ pub struct InterestedPiecesRequest {
|
|||
#[prost(uint32, repeated, tag = "1")]
|
||||
pub piece_numbers: ::prost::alloc::vec::Vec<u32>,
|
||||
}
|
||||
/// 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<sync_pieces_request::Request>,
|
||||
}
|
||||
/// 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<super::common::Piece>,
|
||||
}
|
||||
/// 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<super::common::Metadata>,
|
||||
}
|
||||
/// 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<sync_pieces_response::Response>,
|
||||
#[prost(oneof = "sync_pieces_response::Errordetails", tags = "3, 4")]
|
||||
#[prost(oneof = "sync_pieces_response::Errordetails", tags = "3")]
|
||||
pub errordetails: ::core::option::Option<sync_pieces_response::Errordetails>,
|
||||
}
|
||||
/// 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<super::common::Download>,
|
||||
}
|
||||
/// 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<super::common::Metadata>,
|
||||
#[prost(message, optional, tag = "1")]
|
||||
pub task: ::core::option::Option<super::common::Task>,
|
||||
}
|
||||
/// 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<super::common::Task>,
|
||||
}
|
||||
/// 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<super::common::Metadata>,
|
||||
/// 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<super::common::Metadata>,
|
||||
/// 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<super::UploadTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, 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<super::ImportTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, 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<super::ExportTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, 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<super::DownloadTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, tonic::Status>;
|
||||
/// UploadTask uploads task to p2p network.
|
||||
async fn upload_task(
|
||||
&self,
|
||||
request: tonic::Request<super::UploadTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, tonic::Status>;
|
||||
/// StatTask stats task information.
|
||||
async fn stat_task(
|
||||
&self,
|
||||
request: tonic::Request<super::StatTaskRequest>,
|
||||
) -> Result<tonic::Response<super::super::common::Task>, tonic::Status>;
|
||||
/// ImportTask imports task to p2p network.
|
||||
async fn import_task(
|
||||
&self,
|
||||
request: tonic::Request<super::ImportTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, tonic::Status>;
|
||||
/// ExportTask exports task from p2p network.
|
||||
async fn export_task(
|
||||
&self,
|
||||
request: tonic::Request<super::ExportTaskRequest>,
|
||||
) -> Result<tonic::Response<()>, 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<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
T: Dfdaemon,
|
||||
> tonic::server::UnaryService<super::UploadTaskRequest>
|
||||
for UploadTaskSvc<T> {
|
||||
type Response = ();
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::UploadTaskRequest>,
|
||||
) -> 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<T: Dfdaemon>(pub Arc<T>);
|
||||
|
@ -562,82 +529,6 @@ pub mod dfdaemon_server {
|
|||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/dfdaemon.Dfdaemon/ImportTask" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ImportTaskSvc<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
T: Dfdaemon,
|
||||
> tonic::server::UnaryService<super::ImportTaskRequest>
|
||||
for ImportTaskSvc<T> {
|
||||
type Response = ();
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::ImportTaskRequest>,
|
||||
) -> 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<T: Dfdaemon>(pub Arc<T>);
|
||||
impl<
|
||||
T: Dfdaemon,
|
||||
> tonic::server::UnaryService<super::ExportTaskRequest>
|
||||
for ExportTaskSvc<T> {
|
||||
type Response = ();
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::ExportTaskRequest>,
|
||||
) -> 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<T: Dfdaemon>(pub Arc<T>);
|
||||
|
|
|
@ -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<super::common::ExtendAttribute>,
|
||||
pub extend_attribute: ::core::option::Option<super::common::ExtendAttribute>,
|
||||
/// 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<super::common::ExtendAttribute>,
|
||||
pub extend_attribute: ::core::option::Option<super::common::ExtendAttribute>,
|
||||
/// 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,
|
||||
}
|
||||
|
|
|
@ -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<super::common::Metadata>,
|
||||
pub download: ::core::option::Option<super::common::Download>,
|
||||
}
|
||||
/// DownloadPeerStartedRequest represents peer download started request of AnnouncePeerRequest.
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
|
|
Loading…
Reference in New Issue