Documentation ¶
Index ¶
- Variables
- type Download
- func (*Download) Descriptor() ([]byte, []int)deprecated
- func (x *Download) GetApplication() string
- func (x *Download) GetDigest() string
- func (x *Download) GetDownloadRateLimit() float64
- func (x *Download) GetFilters() []string
- func (x *Download) GetHeader() map[string]string
- func (x *Download) GetNeedBackToSource() bool
- func (x *Download) GetOutputPath() string
- func (x *Download) GetPieceLength() int32
- func (x *Download) GetPriority() Priority
- func (x *Download) GetRange() *Range
- func (x *Download) GetTag() string
- func (x *Download) GetTimeout() *durationpb.Duration
- func (x *Download) GetType() TaskType
- func (x *Download) GetUrl() string
- func (*Download) ProtoMessage()
- func (x *Download) ProtoReflect() protoreflect.Message
- func (x *Download) Reset()
- func (x *Download) String() string
- func (m *Download) Validate() error
- func (m *Download) ValidateAll() error
- type DownloadMultiError
- type DownloadValidationError
- type ExtendAttribute
- func (*ExtendAttribute) Descriptor() ([]byte, []int)deprecated
- func (x *ExtendAttribute) GetHeader() map[string]string
- func (x *ExtendAttribute) GetStatus() string
- func (x *ExtendAttribute) GetStatusCode() int32
- func (*ExtendAttribute) ProtoMessage()
- func (x *ExtendAttribute) ProtoReflect() protoreflect.Message
- func (x *ExtendAttribute) Reset()
- func (x *ExtendAttribute) String() string
- func (m *ExtendAttribute) Validate() error
- func (m *ExtendAttribute) ValidateAll() error
- type ExtendAttributeMultiError
- type ExtendAttributeValidationError
- func (e ExtendAttributeValidationError) Cause() error
- func (e ExtendAttributeValidationError) Error() string
- func (e ExtendAttributeValidationError) ErrorName() string
- func (e ExtendAttributeValidationError) Field() string
- func (e ExtendAttributeValidationError) Key() bool
- func (e ExtendAttributeValidationError) Reason() string
- type Host
- func (*Host) Descriptor() ([]byte, []int)deprecated
- func (x *Host) GetDownloadPort() int32
- func (x *Host) GetHostname() string
- func (x *Host) GetId() string
- func (x *Host) GetIdc() string
- func (x *Host) GetIp() string
- func (x *Host) GetLocation() string
- func (x *Host) GetPort() int32
- func (x *Host) GetSecurityDomain() string
- func (*Host) ProtoMessage()
- func (x *Host) ProtoReflect() protoreflect.Message
- func (x *Host) Reset()
- func (x *Host) String() string
- func (m *Host) Validate() error
- func (m *Host) ValidateAll() error
- type HostMultiError
- type HostValidationError
- type Peer
- func (*Peer) Descriptor() ([]byte, []int)deprecated
- func (x *Peer) GetCost() *durationpb.Duration
- func (x *Peer) GetCreatedAt() *timestamppb.Timestamp
- func (x *Peer) GetHost() *Host
- func (x *Peer) GetId() string
- func (x *Peer) GetNeedBackToSource() bool
- func (x *Peer) GetPieces() []*Piece
- func (x *Peer) GetPriority() Priority
- func (x *Peer) GetRange() *Range
- func (x *Peer) GetState() string
- func (x *Peer) GetTask() *Task
- func (x *Peer) GetUpdatedAt() *timestamppb.Timestamp
- func (*Peer) ProtoMessage()
- func (x *Peer) ProtoReflect() protoreflect.Message
- func (x *Peer) Reset()
- func (x *Peer) String() string
- func (m *Peer) Validate() error
- func (m *Peer) ValidateAll() error
- type PeerMultiError
- type PeerValidationError
- type Piece
- func (*Piece) Descriptor() ([]byte, []int)deprecated
- func (x *Piece) GetCost() *durationpb.Duration
- func (x *Piece) GetCreatedAt() *timestamppb.Timestamp
- func (x *Piece) GetDigest() string
- func (x *Piece) GetLength() uint64
- func (x *Piece) GetNumber() uint32
- func (x *Piece) GetOffset() uint64
- func (x *Piece) GetParentId() string
- func (x *Piece) GetTrafficType() TrafficType
- func (*Piece) ProtoMessage()
- func (x *Piece) ProtoReflect() protoreflect.Message
- func (x *Piece) Reset()
- func (x *Piece) String() string
- func (m *Piece) Validate() error
- func (m *Piece) ValidateAll() error
- type PieceMultiError
- type PieceValidationError
- type Priority
- type Range
- func (*Range) Descriptor() ([]byte, []int)deprecated
- func (x *Range) GetLength() int64
- func (x *Range) GetStart() int64
- func (*Range) ProtoMessage()
- func (x *Range) ProtoReflect() protoreflect.Message
- func (x *Range) Reset()
- func (x *Range) String() string
- func (m *Range) Validate() error
- func (m *Range) ValidateAll() error
- type RangeMultiError
- type RangeValidationError
- type SizeScope
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetApplication() string
- func (x *Task) GetContentLength() int64
- func (x *Task) GetCreatedAt() *timestamppb.Timestamp
- func (x *Task) GetDigest() string
- func (x *Task) GetFilters() []string
- func (x *Task) GetHasAvailablePeer() bool
- func (x *Task) GetHeader() map[string]string
- func (x *Task) GetId() string
- func (x *Task) GetPeerCount() int32
- func (x *Task) GetPieceCount() int64
- func (x *Task) GetPieceLength() int32
- func (x *Task) GetPieces() []*Piece
- func (x *Task) GetSizeScope() SizeScope
- func (x *Task) GetState() string
- func (x *Task) GetTag() string
- func (x *Task) GetType() string
- func (x *Task) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Task) GetUrl() string
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- func (m *Task) Validate() error
- func (m *Task) ValidateAll() error
- type TaskMultiError
- type TaskType
- type TaskValidationError
- type TrafficType
- func (TrafficType) Descriptor() protoreflect.EnumDescriptor
- func (x TrafficType) Enum() *TrafficType
- func (TrafficType) EnumDescriptor() ([]byte, []int)deprecated
- func (x TrafficType) Number() protoreflect.EnumNumber
- func (x TrafficType) String() string
- func (TrafficType) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( SizeScope_name = map[int32]string{ 0: "NORMAL", 1: "SMALL", 2: "TINY", 3: "EMPTY", } SizeScope_value = map[string]int32{ "NORMAL": 0, "SMALL": 1, "TINY": 2, "EMPTY": 3, } )
Enum value maps for SizeScope.
var ( TaskType_name = map[int32]string{ 0: "DFDAEMON", 1: "DFCACHE", 2: "DFSTORE", } TaskType_value = map[string]int32{ "DFDAEMON": 0, "DFCACHE": 1, "DFSTORE": 2, } )
Enum value maps for TaskType.
var ( TrafficType_name = map[int32]string{ 0: "BACK_TO_SOURCE", 1: "REMOTE_PEER", 2: "LOCAL_PEER", } TrafficType_value = map[string]int32{ "BACK_TO_SOURCE": 0, "REMOTE_PEER": 1, "LOCAL_PEER": 2, } )
Enum value maps for TrafficType.
var ( Priority_name = map[int32]string{ 0: "LEVEL0", 1: "LEVEL1", 2: "LEVEL2", 3: "LEVEL3", 4: "LEVEL4", 5: "LEVEL5", 6: "LEVEL6", } Priority_value = map[string]int32{ "LEVEL0": 0, "LEVEL1": 1, "LEVEL2": 2, "LEVEL3": 3, "LEVEL4": 4, "LEVEL5": 5, "LEVEL6": 6, } )
Enum value maps for Priority.
var File_pkg_apis_common_v2_common_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Download ¶ added in v1.5.0
type Download struct { // Download url. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // Digest of the pieces digest, for example md5:xxx or sha256:yyy. Digest string `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` // Range is url range of request. Range *Range `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` // Task type. Type TaskType `protobuf:"varint,4,opt,name=type,proto3,enum=common.v2.TaskType" json:"type,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"` // Peer priority. Priority Priority `protobuf:"varint,7,opt,name=priority,proto3,enum=common.v2.Priority" json:"priority,omitempty"` // Filter url used to generate task id. Filters []string `protobuf:"bytes,8,rep,name=filters,proto3" json:"filters,omitempty"` // Task request headers. Header map[string]string `` /* 153-byte string literal not displayed */ // Task piece length. PieceLength int32 `protobuf:"varint,10,opt,name=piece_length,json=pieceLength,proto3" json:"piece_length,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"` // contains filtered or unexported fields }
Download information.
func (*Download) Descriptor
deprecated
added in
v1.5.0
func (*Download) GetApplication ¶ added in v1.5.0
func (*Download) GetDownloadRateLimit ¶ added in v1.5.0
func (*Download) GetFilters ¶ added in v1.5.0
func (*Download) GetNeedBackToSource ¶ added in v1.5.0
func (*Download) GetOutputPath ¶ added in v1.5.0
func (*Download) GetPieceLength ¶ added in v1.5.2
func (*Download) GetPriority ¶ added in v1.5.0
func (*Download) GetTimeout ¶ added in v1.5.0
func (x *Download) GetTimeout() *durationpb.Duration
func (*Download) ProtoMessage ¶ added in v1.5.0
func (*Download) ProtoMessage()
func (*Download) ProtoReflect ¶ added in v1.5.0
func (x *Download) ProtoReflect() protoreflect.Message
func (*Download) Validate ¶ added in v1.5.0
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 (*Download) ValidateAll ¶ added in v1.5.0
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 DownloadMultiError, or nil if none found.
type DownloadMultiError ¶ added in v1.5.0
type DownloadMultiError []error
DownloadMultiError is an error wrapping multiple validation errors returned by Download.ValidateAll() if the designated constraints aren't met.
func (DownloadMultiError) AllErrors ¶ added in v1.5.0
func (m DownloadMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (DownloadMultiError) Error ¶ added in v1.5.0
func (m DownloadMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type DownloadValidationError ¶ added in v1.5.0
type DownloadValidationError struct {
// contains filtered or unexported fields
}
DownloadValidationError is the validation error returned by Download.Validate if the designated constraints aren't met.
func (DownloadValidationError) Cause ¶ added in v1.5.0
func (e DownloadValidationError) Cause() error
Cause function returns cause value.
func (DownloadValidationError) Error ¶ added in v1.5.0
func (e DownloadValidationError) Error() string
Error satisfies the builtin error interface
func (DownloadValidationError) ErrorName ¶ added in v1.5.0
func (e DownloadValidationError) ErrorName() string
ErrorName returns error name.
func (DownloadValidationError) Field ¶ added in v1.5.0
func (e DownloadValidationError) Field() string
Field function returns field value.
func (DownloadValidationError) Key ¶ added in v1.5.0
func (e DownloadValidationError) Key() bool
Key function returns key value.
func (DownloadValidationError) Reason ¶ added in v1.5.0
func (e DownloadValidationError) Reason() string
Reason function returns reason value.
type ExtendAttribute ¶
type ExtendAttribute struct { // Task response header, eg: HTTP Response Header Header map[string]string `` /* 153-byte string literal not displayed */ // Task response code, eg: HTTP Status Code StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // Task response status, eg: HTTP Status Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
ExtendAttribute represents extend of attribution.
func (*ExtendAttribute) Descriptor
deprecated
func (*ExtendAttribute) Descriptor() ([]byte, []int)
Deprecated: Use ExtendAttribute.ProtoReflect.Descriptor instead.
func (*ExtendAttribute) GetHeader ¶
func (x *ExtendAttribute) GetHeader() map[string]string
func (*ExtendAttribute) GetStatus ¶
func (x *ExtendAttribute) GetStatus() string
func (*ExtendAttribute) GetStatusCode ¶
func (x *ExtendAttribute) GetStatusCode() int32
func (*ExtendAttribute) ProtoMessage ¶
func (*ExtendAttribute) ProtoMessage()
func (*ExtendAttribute) ProtoReflect ¶
func (x *ExtendAttribute) ProtoReflect() protoreflect.Message
func (*ExtendAttribute) Reset ¶
func (x *ExtendAttribute) Reset()
func (*ExtendAttribute) String ¶
func (x *ExtendAttribute) String() string
func (*ExtendAttribute) Validate ¶
func (m *ExtendAttribute) Validate() error
Validate checks the field values on ExtendAttribute 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 (*ExtendAttribute) ValidateAll ¶
func (m *ExtendAttribute) ValidateAll() error
ValidateAll checks the field values on ExtendAttribute 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 ExtendAttributeMultiError, or nil if none found.
type ExtendAttributeMultiError ¶
type ExtendAttributeMultiError []error
ExtendAttributeMultiError is an error wrapping multiple validation errors returned by ExtendAttribute.ValidateAll() if the designated constraints aren't met.
func (ExtendAttributeMultiError) AllErrors ¶
func (m ExtendAttributeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ExtendAttributeMultiError) Error ¶
func (m ExtendAttributeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ExtendAttributeValidationError ¶
type ExtendAttributeValidationError struct {
// contains filtered or unexported fields
}
ExtendAttributeValidationError is the validation error returned by ExtendAttribute.Validate if the designated constraints aren't met.
func (ExtendAttributeValidationError) Cause ¶
func (e ExtendAttributeValidationError) Cause() error
Cause function returns cause value.
func (ExtendAttributeValidationError) Error ¶
func (e ExtendAttributeValidationError) Error() string
Error satisfies the builtin error interface
func (ExtendAttributeValidationError) ErrorName ¶
func (e ExtendAttributeValidationError) ErrorName() string
ErrorName returns error name.
func (ExtendAttributeValidationError) Field ¶
func (e ExtendAttributeValidationError) Field() string
Field function returns field value.
func (ExtendAttributeValidationError) Key ¶
func (e ExtendAttributeValidationError) Key() bool
Key function returns key value.
func (ExtendAttributeValidationError) Reason ¶
func (e ExtendAttributeValidationError) Reason() string
Reason function returns reason value.
type Host ¶ added in v1.4.1
type Host struct { // Host id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Host ip. Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` // Peer hostname. Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` // Port of grpc service. Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` // Port of download server. DownloadPort int32 `protobuf:"varint,5,opt,name=download_port,json=downloadPort,proto3" json:"download_port,omitempty"` // Security domain for network. SecurityDomain string `protobuf:"bytes,6,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"` // Host location, eg: area|country|province|city. Location string `protobuf:"bytes,7,opt,name=location,proto3" json:"location,omitempty"` // IDC where the peer host is located. Idc string `protobuf:"bytes,8,opt,name=idc,proto3" json:"idc,omitempty"` // contains filtered or unexported fields }
Host metadata.
func (*Host) Descriptor
deprecated
added in
v1.4.1
func (*Host) GetDownloadPort ¶ added in v1.4.1
func (*Host) GetHostname ¶ added in v1.4.1
func (*Host) GetLocation ¶ added in v1.4.1
func (*Host) GetSecurityDomain ¶ added in v1.4.1
func (*Host) ProtoMessage ¶ added in v1.4.1
func (*Host) ProtoMessage()
func (*Host) ProtoReflect ¶ added in v1.4.1
func (x *Host) ProtoReflect() protoreflect.Message
func (*Host) Validate ¶ added in v1.4.1
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.
func (*Host) ValidateAll ¶ added in v1.4.1
ValidateAll checks the field values on Host 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 HostMultiError, or nil if none found.
type HostMultiError ¶ added in v1.4.1
type HostMultiError []error
HostMultiError is an error wrapping multiple validation errors returned by Host.ValidateAll() if the designated constraints aren't met.
func (HostMultiError) AllErrors ¶ added in v1.4.1
func (m HostMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HostMultiError) Error ¶ added in v1.4.1
func (m HostMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HostValidationError ¶ added in v1.4.1
type HostValidationError struct {
// contains filtered or unexported fields
}
HostValidationError is the validation error returned by Host.Validate if the designated constraints aren't met.
func (HostValidationError) Cause ¶ added in v1.4.1
func (e HostValidationError) Cause() error
Cause function returns cause value.
func (HostValidationError) Error ¶ added in v1.4.1
func (e HostValidationError) Error() string
Error satisfies the builtin error interface
func (HostValidationError) ErrorName ¶ added in v1.4.1
func (e HostValidationError) ErrorName() string
ErrorName returns error name.
func (HostValidationError) Field ¶ added in v1.4.1
func (e HostValidationError) Field() string
Field function returns field value.
func (HostValidationError) Key ¶ added in v1.4.1
func (e HostValidationError) Key() bool
Key function returns key value.
func (HostValidationError) Reason ¶ added in v1.4.1
func (e HostValidationError) Reason() string
Reason function returns reason value.
type Peer ¶ added in v1.4.1
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,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,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,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Peer update time. UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
Peer metadata.
func (*Peer) Descriptor
deprecated
added in
v1.4.1
func (*Peer) GetCost ¶ added in v1.5.0
func (x *Peer) GetCost() *durationpb.Duration
func (*Peer) GetCreatedAt ¶ added in v1.4.1
func (x *Peer) GetCreatedAt() *timestamppb.Timestamp
func (*Peer) GetNeedBackToSource ¶ added in v1.5.0
func (*Peer) GetPriority ¶ added in v1.5.0
func (*Peer) GetUpdatedAt ¶ added in v1.4.1
func (x *Peer) GetUpdatedAt() *timestamppb.Timestamp
func (*Peer) ProtoMessage ¶ added in v1.4.1
func (*Peer) ProtoMessage()
func (*Peer) ProtoReflect ¶ added in v1.4.1
func (x *Peer) ProtoReflect() protoreflect.Message
func (*Peer) Validate ¶ added in v1.4.1
Validate checks the field values on Peer 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 (*Peer) ValidateAll ¶ added in v1.4.1
ValidateAll checks the field values on Peer 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 PeerMultiError, or nil if none found.
type PeerMultiError ¶ added in v1.4.1
type PeerMultiError []error
PeerMultiError is an error wrapping multiple validation errors returned by Peer.ValidateAll() if the designated constraints aren't met.
func (PeerMultiError) AllErrors ¶ added in v1.4.1
func (m PeerMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PeerMultiError) Error ¶ added in v1.4.1
func (m PeerMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PeerValidationError ¶ added in v1.4.1
type PeerValidationError struct {
// contains filtered or unexported fields
}
PeerValidationError is the validation error returned by Peer.Validate if the designated constraints aren't met.
func (PeerValidationError) Cause ¶ added in v1.4.1
func (e PeerValidationError) Cause() error
Cause function returns cause value.
func (PeerValidationError) Error ¶ added in v1.4.1
func (e PeerValidationError) Error() string
Error satisfies the builtin error interface
func (PeerValidationError) ErrorName ¶ added in v1.4.1
func (e PeerValidationError) ErrorName() string
ErrorName returns error name.
func (PeerValidationError) Field ¶ added in v1.4.1
func (e PeerValidationError) Field() string
Field function returns field value.
func (PeerValidationError) Key ¶ added in v1.4.1
func (e PeerValidationError) Key() bool
Key function returns key value.
func (PeerValidationError) Reason ¶ added in v1.4.1
func (e PeerValidationError) Reason() string
Reason function returns reason value.
type Piece ¶
type Piece struct { // Piece number. Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // Parent peer id. ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` // Piece offset. Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // Piece length. Length uint64 `protobuf:"varint,4,opt,name=length,proto3" json:"length,omitempty"` // Digest of the piece data, for example md5:xxx or sha256:yyy. Digest string `protobuf:"bytes,5,opt,name=digest,proto3" json:"digest,omitempty"` // Traffic type. TrafficType TrafficType `protobuf:"varint,6,opt,name=traffic_type,json=trafficType,proto3,enum=common.v2.TrafficType" json:"traffic_type,omitempty"` // Downloading piece costs time. Cost *durationpb.Duration `protobuf:"bytes,7,opt,name=cost,proto3" json:"cost,omitempty"` // Piece create time. CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
Piece represents information of piece.
func (*Piece) Descriptor
deprecated
func (*Piece) GetCost ¶
func (x *Piece) GetCost() *durationpb.Duration
func (*Piece) GetCreatedAt ¶
func (x *Piece) GetCreatedAt() *timestamppb.Timestamp
func (*Piece) GetParentId ¶
func (*Piece) GetTrafficType ¶ added in v1.2.3
func (x *Piece) GetTrafficType() TrafficType
func (*Piece) ProtoMessage ¶
func (*Piece) ProtoMessage()
func (*Piece) ProtoReflect ¶
func (x *Piece) ProtoReflect() protoreflect.Message
func (*Piece) Validate ¶
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 error encountered is returned, or nil if there are no violations.
func (*Piece) ValidateAll ¶
ValidateAll checks the field values on Piece 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 PieceMultiError, or nil if none found.
type PieceMultiError ¶
type PieceMultiError []error
PieceMultiError is an error wrapping multiple validation errors returned by Piece.ValidateAll() if the designated constraints aren't met.
func (PieceMultiError) AllErrors ¶
func (m PieceMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PieceMultiError) Error ¶
func (m PieceMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PieceValidationError ¶
type PieceValidationError struct {
// contains filtered or unexported fields
}
PieceValidationError is the validation error returned by Piece.Validate if the designated constraints aren't met.
func (PieceValidationError) Cause ¶
func (e PieceValidationError) Cause() error
Cause function returns cause value.
func (PieceValidationError) Error ¶
func (e PieceValidationError) Error() string
Error satisfies the builtin error interface
func (PieceValidationError) ErrorName ¶
func (e PieceValidationError) ErrorName() string
ErrorName returns error name.
func (PieceValidationError) Field ¶
func (e PieceValidationError) Field() string
Field function returns field value.
func (PieceValidationError) Key ¶
func (e PieceValidationError) Key() bool
Key function returns key value.
func (PieceValidationError) Reason ¶
func (e PieceValidationError) Reason() string
Reason function returns reason value.
type Priority ¶ added in v1.3.7
type Priority int32
Priority represents priority of application.
const ( // LEVEL0 has no special meaning for scheduler. Priority_LEVEL0 Priority = 0 // LEVEL1 represents the download task is forbidden, // and an error code is returned during the registration. Priority_LEVEL1 Priority = 1 // LEVEL2 represents when the task is downloaded for the first time, // allow peers to download from the other peers, // but not back-to-source. When the task is not downloaded for // the first time, it is scheduled normally. Priority_LEVEL2 Priority = 2 // LEVEL3 represents when the task is downloaded for the first time, // the normal peer is first to download back-to-source. // When the task is not downloaded for the first time, it is scheduled normally. Priority_LEVEL3 Priority = 3 // LEVEL4 represents when the task is downloaded for the first time, // the weak peer is first triggered to back-to-source. // When the task is not downloaded for the first time, it is scheduled normally. Priority_LEVEL4 Priority = 4 // LEVEL5 represents when the task is downloaded for the first time, // the strong peer is first triggered to back-to-source. // When the task is not downloaded for the first time, it is scheduled normally. Priority_LEVEL5 Priority = 5 // LEVEL6 represents when the task is downloaded for the first time, // the super peer is first triggered to back-to-source. // When the task is not downloaded for the first time, it is scheduled normally. Priority_LEVEL6 Priority = 6 )
func (Priority) Descriptor ¶ added in v1.3.7
func (Priority) Descriptor() protoreflect.EnumDescriptor
func (Priority) EnumDescriptor
deprecated
added in
v1.3.7
func (Priority) Number ¶ added in v1.3.7
func (x Priority) Number() protoreflect.EnumNumber
func (Priority) Type ¶ added in v1.3.7
func (Priority) Type() protoreflect.EnumType
type Range ¶
type Range struct { // Start of range. Start int64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` // Length of range. Length int64 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // contains filtered or unexported fields }
Range represents download range.
func (*Range) Descriptor
deprecated
func (*Range) ProtoMessage ¶
func (*Range) ProtoMessage()
func (*Range) ProtoReflect ¶
func (x *Range) ProtoReflect() protoreflect.Message
func (*Range) Validate ¶
Validate checks the field values on Range 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 (*Range) ValidateAll ¶
ValidateAll checks the field values on Range 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 RangeMultiError, or nil if none found.
type RangeMultiError ¶
type RangeMultiError []error
RangeMultiError is an error wrapping multiple validation errors returned by Range.ValidateAll() if the designated constraints aren't met.
func (RangeMultiError) AllErrors ¶
func (m RangeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RangeMultiError) Error ¶
func (m RangeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RangeValidationError ¶
type RangeValidationError struct {
// contains filtered or unexported fields
}
RangeValidationError is the validation error returned by Range.Validate if the designated constraints aren't met.
func (RangeValidationError) Cause ¶
func (e RangeValidationError) Cause() error
Cause function returns cause value.
func (RangeValidationError) Error ¶
func (e RangeValidationError) Error() string
Error satisfies the builtin error interface
func (RangeValidationError) ErrorName ¶
func (e RangeValidationError) ErrorName() string
ErrorName returns error name.
func (RangeValidationError) Field ¶
func (e RangeValidationError) Field() string
Field function returns field value.
func (RangeValidationError) Key ¶
func (e RangeValidationError) Key() bool
Key function returns key value.
func (RangeValidationError) Reason ¶
func (e RangeValidationError) Reason() string
Reason function returns reason value.
type SizeScope ¶
type SizeScope int32
SizeScope represents size scope of task.
func (SizeScope) Descriptor ¶
func (SizeScope) Descriptor() protoreflect.EnumDescriptor
func (SizeScope) EnumDescriptor
deprecated
func (SizeScope) Number ¶
func (x SizeScope) Number() protoreflect.EnumNumber
func (SizeScope) Type ¶
func (SizeScope) Type() protoreflect.EnumType
type Task ¶ added in v1.4.1
type Task struct { // Task id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Task type. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,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 `` /* 153-byte string literal not displayed */ // Task piece length. PieceLength int32 `protobuf:"varint,9,opt,name=piece_length,json=pieceLength,proto3" json:"piece_length,omitempty"` // Task content length. 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,15,opt,name=peer_count,json=peerCount,proto3" json:"peer_count,omitempty"` // Task contains available peer. HasAvailablePeer bool `protobuf:"varint,16,opt,name=hasAvailablePeer,proto3" json:"hasAvailablePeer,omitempty"` // Task create time. 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,18,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
Task metadata.
func (*Task) Descriptor
deprecated
added in
v1.4.1
func (*Task) GetApplication ¶ added in v1.5.0
func (*Task) GetContentLength ¶ added in v1.4.1
func (*Task) GetCreatedAt ¶ added in v1.4.1
func (x *Task) GetCreatedAt() *timestamppb.Timestamp
func (*Task) GetFilters ¶ added in v1.5.0
func (*Task) GetHasAvailablePeer ¶ added in v1.4.1
func (*Task) GetPeerCount ¶ added in v1.4.1
func (*Task) GetPieceCount ¶ added in v1.5.0
func (*Task) GetPieceLength ¶ added in v1.5.2
func (*Task) GetSizeScope ¶ added in v1.4.1
func (*Task) GetUpdatedAt ¶ added in v1.4.1
func (x *Task) GetUpdatedAt() *timestamppb.Timestamp
func (*Task) ProtoMessage ¶ added in v1.4.1
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶ added in v1.4.1
func (x *Task) ProtoReflect() protoreflect.Message
func (*Task) Validate ¶ added in v1.4.1
Validate checks the field values on Task 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 (*Task) ValidateAll ¶ added in v1.4.1
ValidateAll checks the field values on Task 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 TaskMultiError, or nil if none found.
type TaskMultiError ¶ added in v1.4.1
type TaskMultiError []error
TaskMultiError is an error wrapping multiple validation errors returned by Task.ValidateAll() if the designated constraints aren't met.
func (TaskMultiError) AllErrors ¶ added in v1.4.1
func (m TaskMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (TaskMultiError) Error ¶ added in v1.4.1
func (m TaskMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type TaskType ¶
type TaskType int32
TaskType represents type of task.
const ( // DFDAEMON is dfdeamon type of task, // dfdeamon task is a normal p2p task. TaskType_DFDAEMON TaskType = 0 // DFCACHE is dfcache type of task, // dfcache task is a cache task, and the task url is fake url. // It can only be used for caching and cannot be downloaded back to source. TaskType_DFCACHE TaskType = 1 // DFSTORE is dfstore type of task, // dfstore task is a persistent task in backend. TaskType_DFSTORE TaskType = 2 )
func (TaskType) Descriptor ¶
func (TaskType) Descriptor() protoreflect.EnumDescriptor
func (TaskType) EnumDescriptor
deprecated
func (TaskType) Number ¶
func (x TaskType) Number() protoreflect.EnumNumber
func (TaskType) Type ¶
func (TaskType) Type() protoreflect.EnumType
type TaskValidationError ¶ added in v1.4.1
type TaskValidationError struct {
// contains filtered or unexported fields
}
TaskValidationError is the validation error returned by Task.Validate if the designated constraints aren't met.
func (TaskValidationError) Cause ¶ added in v1.4.1
func (e TaskValidationError) Cause() error
Cause function returns cause value.
func (TaskValidationError) Error ¶ added in v1.4.1
func (e TaskValidationError) Error() string
Error satisfies the builtin error interface
func (TaskValidationError) ErrorName ¶ added in v1.4.1
func (e TaskValidationError) ErrorName() string
ErrorName returns error name.
func (TaskValidationError) Field ¶ added in v1.4.1
func (e TaskValidationError) Field() string
Field function returns field value.
func (TaskValidationError) Key ¶ added in v1.4.1
func (e TaskValidationError) Key() bool
Key function returns key value.
func (TaskValidationError) Reason ¶ added in v1.4.1
func (e TaskValidationError) Reason() string
Reason function returns reason value.
type TrafficType ¶ added in v1.2.3
type TrafficType int32
TrafficType represents type of traffic.
const ( // BACK_TO_SOURCE is to download traffic from the source. TrafficType_BACK_TO_SOURCE TrafficType = 0 // REMOTE_PEER is to download traffic from the remote peer. TrafficType_REMOTE_PEER TrafficType = 1 // LOCAL_PEER is to download traffic from the local peer. TrafficType_LOCAL_PEER TrafficType = 2 )
func (TrafficType) Descriptor ¶ added in v1.2.3
func (TrafficType) Descriptor() protoreflect.EnumDescriptor
func (TrafficType) Enum ¶ added in v1.2.3
func (x TrafficType) Enum() *TrafficType
func (TrafficType) EnumDescriptor
deprecated
added in
v1.2.3
func (TrafficType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TrafficType.Descriptor instead.
func (TrafficType) Number ¶ added in v1.2.3
func (x TrafficType) Number() protoreflect.EnumNumber
func (TrafficType) String ¶ added in v1.2.3
func (x TrafficType) String() string
func (TrafficType) Type ¶ added in v1.2.3
func (TrafficType) Type() protoreflect.EnumType