Documentation ¶
Index ¶
- Variables
- type Code
- 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 GrpcDfError
- func (*GrpcDfError) Descriptor() ([]byte, []int)deprecated
- func (x *GrpcDfError) GetCode() Code
- func (x *GrpcDfError) GetMessage() string
- func (*GrpcDfError) ProtoMessage()
- func (x *GrpcDfError) ProtoReflect() protoreflect.Message
- func (x *GrpcDfError) Reset()
- func (x *GrpcDfError) String() string
- func (m *GrpcDfError) Validate() error
- func (m *GrpcDfError) ValidateAll() error
- type GrpcDfErrorMultiError
- type GrpcDfErrorValidationError
- func (e GrpcDfErrorValidationError) Cause() error
- func (e GrpcDfErrorValidationError) Error() string
- func (e GrpcDfErrorValidationError) ErrorName() string
- func (e GrpcDfErrorValidationError) Field() string
- func (e GrpcDfErrorValidationError) Key() bool
- func (e GrpcDfErrorValidationError) 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 (*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 PieceInfo
- func (*PieceInfo) Descriptor() ([]byte, []int)deprecated
- func (x *PieceInfo) GetDownloadCost() uint64
- func (x *PieceInfo) GetPieceMd5() string
- func (x *PieceInfo) GetPieceNum() int32
- func (x *PieceInfo) GetPieceOffset() uint64
- func (x *PieceInfo) GetPieceStyle() PieceStyle
- func (x *PieceInfo) GetRangeSize() uint32
- func (x *PieceInfo) GetRangeStart() uint64
- func (*PieceInfo) ProtoMessage()
- func (x *PieceInfo) ProtoReflect() protoreflect.Message
- func (x *PieceInfo) Reset()
- func (x *PieceInfo) String() string
- func (m *PieceInfo) Validate() error
- func (m *PieceInfo) ValidateAll() error
- type PieceInfoMultiError
- type PieceInfoValidationError
- type PiecePacket
- func (*PiecePacket) Descriptor() ([]byte, []int)deprecated
- func (x *PiecePacket) GetContentLength() int64
- func (x *PiecePacket) GetDstAddr() string
- func (x *PiecePacket) GetDstPid() string
- func (x *PiecePacket) GetExtendAttribute() *ExtendAttribute
- func (x *PiecePacket) GetPieceInfos() []*PieceInfo
- func (x *PiecePacket) GetPieceMd5Sign() string
- func (x *PiecePacket) GetTaskId() string
- func (x *PiecePacket) GetTotalPiece() int32
- func (*PiecePacket) ProtoMessage()
- func (x *PiecePacket) ProtoReflect() protoreflect.Message
- func (x *PiecePacket) Reset()
- func (x *PiecePacket) String() string
- func (m *PiecePacket) Validate() error
- func (m *PiecePacket) ValidateAll() error
- type PiecePacketMultiError
- type PiecePacketValidationError
- func (e PiecePacketValidationError) Cause() error
- func (e PiecePacketValidationError) Error() string
- func (e PiecePacketValidationError) ErrorName() string
- func (e PiecePacketValidationError) Field() string
- func (e PiecePacketValidationError) Key() bool
- func (e PiecePacketValidationError) Reason() string
- type PieceStyle
- type PieceTaskRequest
- func (*PieceTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PieceTaskRequest) GetDstPid() string
- func (x *PieceTaskRequest) GetLimit() uint32
- func (x *PieceTaskRequest) GetSrcPid() string
- func (x *PieceTaskRequest) GetStartNum() uint32
- func (x *PieceTaskRequest) GetTaskId() string
- func (*PieceTaskRequest) ProtoMessage()
- func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message
- func (x *PieceTaskRequest) Reset()
- func (x *PieceTaskRequest) String() string
- func (m *PieceTaskRequest) Validate() error
- func (m *PieceTaskRequest) ValidateAll() error
- type PieceTaskRequestMultiError
- type PieceTaskRequestValidationError
- func (e PieceTaskRequestValidationError) Cause() error
- func (e PieceTaskRequestValidationError) Error() string
- func (e PieceTaskRequestValidationError) ErrorName() string
- func (e PieceTaskRequestValidationError) Field() string
- func (e PieceTaskRequestValidationError) Key() bool
- func (e PieceTaskRequestValidationError) Reason() string
- type Priority
- type SizeScope
- type TaskType
- type UrlMeta
- func (*UrlMeta) Descriptor() ([]byte, []int)deprecated
- func (x *UrlMeta) GetApplication() string
- func (x *UrlMeta) GetDigest() string
- func (x *UrlMeta) GetFilter() string
- func (x *UrlMeta) GetHeader() map[string]string
- func (x *UrlMeta) GetPriority() Priority
- func (x *UrlMeta) GetRange() string
- func (x *UrlMeta) GetTag() string
- func (*UrlMeta) ProtoMessage()
- func (x *UrlMeta) ProtoReflect() protoreflect.Message
- func (x *UrlMeta) Reset()
- func (x *UrlMeta) String() string
- func (m *UrlMeta) Validate() error
- func (m *UrlMeta) ValidateAll() error
- type UrlMetaMultiError
- type UrlMetaValidationError
Constants ¶
This section is empty.
Variables ¶
var ( Code_name = map[int32]string{ 0: "X_UNSPECIFIED", 200: "Success", 500: "ServerUnavailable", 1000: "ResourceLacked", 1001: "BackToSourceAborted", 1400: "BadRequest", 1404: "PeerTaskNotFound", 1500: "UnknownError", 1504: "RequestTimeOut", 4000: "ClientError", 4001: "ClientPieceRequestFail", 4002: "ClientScheduleTimeout", 4003: "ClientContextCanceled", 4004: "ClientWaitPieceReady", 4005: "ClientPieceDownloadFail", 4006: "ClientRequestLimitFail", 4007: "ClientConnectionError", 4008: "ClientBackSourceError", 4404: "ClientPieceNotFound", 5000: "SchedError", 5001: "SchedNeedBackSource", 5002: "SchedPeerGone", 5004: "SchedPeerNotFound", 5005: "SchedPeerPieceResultReportFail", 5006: "SchedTaskStatusError", 5007: "SchedReregister", 5008: "SchedForbidden", 6001: "CDNTaskRegistryFail", 6404: "CDNTaskNotFound", 7001: "InvalidResourceType", } Code_value = map[string]int32{ "X_UNSPECIFIED": 0, "Success": 200, "ServerUnavailable": 500, "ResourceLacked": 1000, "BackToSourceAborted": 1001, "BadRequest": 1400, "PeerTaskNotFound": 1404, "UnknownError": 1500, "RequestTimeOut": 1504, "ClientError": 4000, "ClientPieceRequestFail": 4001, "ClientScheduleTimeout": 4002, "ClientContextCanceled": 4003, "ClientWaitPieceReady": 4004, "ClientPieceDownloadFail": 4005, "ClientRequestLimitFail": 4006, "ClientConnectionError": 4007, "ClientBackSourceError": 4008, "ClientPieceNotFound": 4404, "SchedError": 5000, "SchedNeedBackSource": 5001, "SchedPeerGone": 5002, "SchedPeerNotFound": 5004, "SchedPeerPieceResultReportFail": 5005, "SchedTaskStatusError": 5006, "SchedReregister": 5007, "SchedForbidden": 5008, "CDNTaskRegistryFail": 6001, "CDNTaskNotFound": 6404, "InvalidResourceType": 7001, } )
Enum value maps for Code.
var ( PieceStyle_name = map[int32]string{ 0: "PLAIN", } PieceStyle_value = map[string]int32{ "PLAIN": 0, } )
Enum value maps for PieceStyle.
var ( SizeScope_name = map[int32]string{ 0: "NORMAL", 1: "SMALL", 2: "TINY", 3: "EMPTY", 4: "UNKNOW", } SizeScope_value = map[string]int32{ "NORMAL": 0, "SMALL": 1, "TINY": 2, "EMPTY": 3, "UNKNOW": 4, } )
Enum value maps for SizeScope.
var ( TaskType_name = map[int32]string{ 0: "Normal", 1: "DfCache", 2: "DfStore", } TaskType_value = map[string]int32{ "Normal": 0, "DfCache": 1, "DfStore": 2, } )
Enum value maps for TaskType.
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_v1_common_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code int32
Code represents the code of the grpc api.
const ( Code_X_UNSPECIFIED Code = 0 // Success code 200-299. Code_Success Code = 200 Code_ServerUnavailable Code = 500 // Common response error 1000-1999. // Client can be migrated to another scheduler/CDN. Code_ResourceLacked Code = 1000 Code_BackToSourceAborted Code = 1001 Code_BadRequest Code = 1400 Code_PeerTaskNotFound Code = 1404 Code_UnknownError Code = 1500 Code_RequestTimeOut Code = 1504 // Client response error 4000-4999. Code_ClientError Code = 4000 // Get piece task from other peer error. Code_ClientPieceRequestFail Code = 4001 // Wait scheduler response timeout. Code_ClientScheduleTimeout Code = 4002 Code_ClientContextCanceled Code = 4003 // When target peer downloads from source slowly, should wait. Code_ClientWaitPieceReady Code = 4004 Code_ClientPieceDownloadFail Code = 4005 Code_ClientRequestLimitFail Code = 4006 Code_ClientConnectionError Code = 4007 Code_ClientBackSourceError Code = 4008 Code_ClientPieceNotFound Code = 4404 // Scheduler response error 5000-5999. Code_SchedError Code = 5000 // Client should try to download from source. Code_SchedNeedBackSource Code = 5001 // Client should disconnect from scheduler. Code_SchedPeerGone Code = 5002 // Peer not found in scheduler. Code_SchedPeerNotFound Code = 5004 // Report piece. Code_SchedPeerPieceResultReportFail Code = 5005 // Task status is fail. Code_SchedTaskStatusError Code = 5006 // Task should be reregister. Code_SchedReregister Code = 5007 // Task should be forbidden. Code_SchedForbidden Code = 5008 // CDN system response error 6000-6999. Code_CDNTaskRegistryFail Code = 6001 Code_CDNTaskNotFound Code = 6404 // Manager response error 7000-7999. Code_InvalidResourceType Code = 7001 )
func (Code) Descriptor ¶
func (Code) Descriptor() protoreflect.EnumDescriptor
func (Code) EnumDescriptor
deprecated
func (Code) Number ¶
func (x Code) Number() protoreflect.EnumNumber
func (Code) Type ¶
func (Code) Type() protoreflect.EnumType
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 is extend attribute.
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 GrpcDfError ¶
type GrpcDfError struct { Code Code `protobuf:"varint,1,opt,name=code,proto3,enum=common.Code" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
GrpcDfError represents error of the grpc.
func (*GrpcDfError) Descriptor
deprecated
func (*GrpcDfError) Descriptor() ([]byte, []int)
Deprecated: Use GrpcDfError.ProtoReflect.Descriptor instead.
func (*GrpcDfError) GetCode ¶
func (x *GrpcDfError) GetCode() Code
func (*GrpcDfError) GetMessage ¶
func (x *GrpcDfError) GetMessage() string
func (*GrpcDfError) ProtoMessage ¶
func (*GrpcDfError) ProtoMessage()
func (*GrpcDfError) ProtoReflect ¶
func (x *GrpcDfError) ProtoReflect() protoreflect.Message
func (*GrpcDfError) Reset ¶
func (x *GrpcDfError) Reset()
func (*GrpcDfError) String ¶
func (x *GrpcDfError) String() string
func (*GrpcDfError) Validate ¶
func (m *GrpcDfError) Validate() error
Validate checks the field values on GrpcDfError 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 (*GrpcDfError) ValidateAll ¶
func (m *GrpcDfError) ValidateAll() error
ValidateAll checks the field values on GrpcDfError 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 GrpcDfErrorMultiError, or nil if none found.
type GrpcDfErrorMultiError ¶
type GrpcDfErrorMultiError []error
GrpcDfErrorMultiError is an error wrapping multiple validation errors returned by GrpcDfError.ValidateAll() if the designated constraints aren't met.
func (GrpcDfErrorMultiError) AllErrors ¶
func (m GrpcDfErrorMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GrpcDfErrorMultiError) Error ¶
func (m GrpcDfErrorMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GrpcDfErrorValidationError ¶
type GrpcDfErrorValidationError struct {
// contains filtered or unexported fields
}
GrpcDfErrorValidationError is the validation error returned by GrpcDfError.Validate if the designated constraints aren't met.
func (GrpcDfErrorValidationError) Cause ¶
func (e GrpcDfErrorValidationError) Cause() error
Cause function returns cause value.
func (GrpcDfErrorValidationError) Error ¶
func (e GrpcDfErrorValidationError) Error() string
Error satisfies the builtin error interface
func (GrpcDfErrorValidationError) ErrorName ¶
func (e GrpcDfErrorValidationError) ErrorName() string
ErrorName returns error name.
func (GrpcDfErrorValidationError) Field ¶
func (e GrpcDfErrorValidationError) Field() string
Field function returns field value.
func (GrpcDfErrorValidationError) Key ¶
func (e GrpcDfErrorValidationError) Key() bool
Key function returns key value.
func (GrpcDfErrorValidationError) Reason ¶
func (e GrpcDfErrorValidationError) Reason() string
Reason function returns reason value.
type Host ¶
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"` // 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
func (*Host) GetDownloadPort ¶
func (*Host) GetHostname ¶
func (*Host) GetLocation ¶
func (*Host) ProtoMessage ¶
func (*Host) ProtoMessage()
func (*Host) ProtoReflect ¶
func (x *Host) ProtoReflect() protoreflect.Message
func (*Host) Validate ¶
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 ¶
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 ¶
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 ¶
func (m HostMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HostMultiError) Error ¶
func (m HostMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HostValidationError ¶
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 ¶
func (e HostValidationError) Cause() error
Cause function returns cause value.
func (HostValidationError) Error ¶
func (e HostValidationError) Error() string
Error satisfies the builtin error interface
func (HostValidationError) ErrorName ¶
func (e HostValidationError) ErrorName() string
ErrorName returns error name.
func (HostValidationError) Field ¶
func (e HostValidationError) Field() string
Field function returns field value.
func (HostValidationError) Key ¶
func (e HostValidationError) Key() bool
Key function returns key value.
func (HostValidationError) Reason ¶
func (e HostValidationError) Reason() string
Reason function returns reason value.
type PieceInfo ¶
type PieceInfo struct { // If piece_num is less than zero, it means to start report piece flag. PieceNum int32 `protobuf:"varint,1,opt,name=piece_num,json=pieceNum,proto3" json:"piece_num,omitempty"` RangeStart uint64 `protobuf:"varint,2,opt,name=range_start,json=rangeStart,proto3" json:"range_start,omitempty"` RangeSize uint32 `protobuf:"varint,3,opt,name=range_size,json=rangeSize,proto3" json:"range_size,omitempty"` PieceMd5 string `protobuf:"bytes,4,opt,name=piece_md5,json=pieceMd5,proto3" json:"piece_md5,omitempty"` PieceOffset uint64 `protobuf:"varint,5,opt,name=piece_offset,json=pieceOffset,proto3" json:"piece_offset,omitempty"` PieceStyle PieceStyle `protobuf:"varint,6,opt,name=piece_style,json=pieceStyle,proto3,enum=common.PieceStyle" json:"piece_style,omitempty"` // Cost of the downloading. DownloadCost uint64 `protobuf:"varint,7,opt,name=download_cost,json=downloadCost,proto3" json:"download_cost,omitempty"` // contains filtered or unexported fields }
Piece metadata.
func (*PieceInfo) Descriptor
deprecated
func (*PieceInfo) GetDownloadCost ¶
func (*PieceInfo) GetPieceMd5 ¶
func (*PieceInfo) GetPieceNum ¶
func (*PieceInfo) GetPieceOffset ¶
func (*PieceInfo) GetPieceStyle ¶
func (x *PieceInfo) GetPieceStyle() PieceStyle
func (*PieceInfo) GetRangeSize ¶
func (*PieceInfo) GetRangeStart ¶
func (*PieceInfo) ProtoMessage ¶
func (*PieceInfo) ProtoMessage()
func (*PieceInfo) ProtoReflect ¶
func (x *PieceInfo) ProtoReflect() protoreflect.Message
func (*PieceInfo) Validate ¶
Validate checks the field values on PieceInfo 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 (*PieceInfo) ValidateAll ¶
ValidateAll checks the field values on PieceInfo 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 PieceInfoMultiError, or nil if none found.
type PieceInfoMultiError ¶
type PieceInfoMultiError []error
PieceInfoMultiError is an error wrapping multiple validation errors returned by PieceInfo.ValidateAll() if the designated constraints aren't met.
func (PieceInfoMultiError) AllErrors ¶
func (m PieceInfoMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PieceInfoMultiError) Error ¶
func (m PieceInfoMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PieceInfoValidationError ¶
type PieceInfoValidationError struct {
// contains filtered or unexported fields
}
PieceInfoValidationError is the validation error returned by PieceInfo.Validate if the designated constraints aren't met.
func (PieceInfoValidationError) Cause ¶
func (e PieceInfoValidationError) Cause() error
Cause function returns cause value.
func (PieceInfoValidationError) Error ¶
func (e PieceInfoValidationError) Error() string
Error satisfies the builtin error interface
func (PieceInfoValidationError) ErrorName ¶
func (e PieceInfoValidationError) ErrorName() string
ErrorName returns error name.
func (PieceInfoValidationError) Field ¶
func (e PieceInfoValidationError) Field() string
Field function returns field value.
func (PieceInfoValidationError) Key ¶
func (e PieceInfoValidationError) Key() bool
Key function returns key value.
func (PieceInfoValidationError) Reason ¶
func (e PieceInfoValidationError) Reason() string
Reason function returns reason value.
type PiecePacket ¶
type PiecePacket struct { TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"` // Address of the remote peer. DstAddr string `protobuf:"bytes,4,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"` PieceInfos []*PieceInfo `protobuf:"bytes,5,rep,name=piece_infos,json=pieceInfos,proto3" json:"piece_infos,omitempty"` // Total piece count for url, total_piece represent total piece is unknown. TotalPiece int32 `protobuf:"varint,6,opt,name=total_piece,json=totalPiece,proto3" json:"total_piece,omitempty"` // If content_length is less than zero, it means content length is unknown. ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"` // Sha256 code of all piece md5. PieceMd5Sign string `protobuf:"bytes,8,opt,name=piece_md5_sign,json=pieceMd5Sign,proto3" json:"piece_md5_sign,omitempty"` // Task extend attribute. ExtendAttribute *ExtendAttribute `protobuf:"bytes,9,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"` // contains filtered or unexported fields }
Piece metadata.
func (*PiecePacket) Descriptor
deprecated
func (*PiecePacket) Descriptor() ([]byte, []int)
Deprecated: Use PiecePacket.ProtoReflect.Descriptor instead.
func (*PiecePacket) GetContentLength ¶
func (x *PiecePacket) GetContentLength() int64
func (*PiecePacket) GetDstAddr ¶
func (x *PiecePacket) GetDstAddr() string
func (*PiecePacket) GetDstPid ¶
func (x *PiecePacket) GetDstPid() string
func (*PiecePacket) GetExtendAttribute ¶
func (x *PiecePacket) GetExtendAttribute() *ExtendAttribute
func (*PiecePacket) GetPieceInfos ¶
func (x *PiecePacket) GetPieceInfos() []*PieceInfo
func (*PiecePacket) GetPieceMd5Sign ¶
func (x *PiecePacket) GetPieceMd5Sign() string
func (*PiecePacket) GetTaskId ¶
func (x *PiecePacket) GetTaskId() string
func (*PiecePacket) GetTotalPiece ¶
func (x *PiecePacket) GetTotalPiece() int32
func (*PiecePacket) ProtoMessage ¶
func (*PiecePacket) ProtoMessage()
func (*PiecePacket) ProtoReflect ¶
func (x *PiecePacket) ProtoReflect() protoreflect.Message
func (*PiecePacket) Reset ¶
func (x *PiecePacket) Reset()
func (*PiecePacket) String ¶
func (x *PiecePacket) String() string
func (*PiecePacket) Validate ¶
func (m *PiecePacket) Validate() error
Validate checks the field values on PiecePacket 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 (*PiecePacket) ValidateAll ¶
func (m *PiecePacket) ValidateAll() error
ValidateAll checks the field values on PiecePacket 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 PiecePacketMultiError, or nil if none found.
type PiecePacketMultiError ¶
type PiecePacketMultiError []error
PiecePacketMultiError is an error wrapping multiple validation errors returned by PiecePacket.ValidateAll() if the designated constraints aren't met.
func (PiecePacketMultiError) AllErrors ¶
func (m PiecePacketMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PiecePacketMultiError) Error ¶
func (m PiecePacketMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PiecePacketValidationError ¶
type PiecePacketValidationError struct {
// contains filtered or unexported fields
}
PiecePacketValidationError is the validation error returned by PiecePacket.Validate if the designated constraints aren't met.
func (PiecePacketValidationError) Cause ¶
func (e PiecePacketValidationError) Cause() error
Cause function returns cause value.
func (PiecePacketValidationError) Error ¶
func (e PiecePacketValidationError) Error() string
Error satisfies the builtin error interface
func (PiecePacketValidationError) ErrorName ¶
func (e PiecePacketValidationError) ErrorName() string
ErrorName returns error name.
func (PiecePacketValidationError) Field ¶
func (e PiecePacketValidationError) Field() string
Field function returns field value.
func (PiecePacketValidationError) Key ¶
func (e PiecePacketValidationError) Key() bool
Key function returns key value.
func (PiecePacketValidationError) Reason ¶
func (e PiecePacketValidationError) Reason() string
Reason function returns reason value.
type PieceStyle ¶
type PieceStyle int32
PieceStyle represents the style of piece.
const (
PieceStyle_PLAIN PieceStyle = 0
)
func (PieceStyle) Descriptor ¶
func (PieceStyle) Descriptor() protoreflect.EnumDescriptor
func (PieceStyle) Enum ¶
func (x PieceStyle) Enum() *PieceStyle
func (PieceStyle) EnumDescriptor
deprecated
func (PieceStyle) EnumDescriptor() ([]byte, []int)
Deprecated: Use PieceStyle.Descriptor instead.
func (PieceStyle) Number ¶
func (x PieceStyle) Number() protoreflect.EnumNumber
func (PieceStyle) String ¶
func (x PieceStyle) String() string
func (PieceStyle) Type ¶
func (PieceStyle) Type() protoreflect.EnumType
type PieceTaskRequest ¶
type PieceTaskRequest struct { TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` SrcPid string `protobuf:"bytes,2,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"` DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"` // Piece number. StartNum uint32 `protobuf:"varint,4,opt,name=start_num,json=startNum,proto3" json:"start_num,omitempty"` // Expected piece count, limit = 0 represent request pieces as many shards as possible. Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` // contains filtered or unexported fields }
PieceTaskRequest represents request of PieceTask.
func (*PieceTaskRequest) Descriptor
deprecated
func (*PieceTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use PieceTaskRequest.ProtoReflect.Descriptor instead.
func (*PieceTaskRequest) GetDstPid ¶
func (x *PieceTaskRequest) GetDstPid() string
func (*PieceTaskRequest) GetLimit ¶
func (x *PieceTaskRequest) GetLimit() uint32
func (*PieceTaskRequest) GetSrcPid ¶
func (x *PieceTaskRequest) GetSrcPid() string
func (*PieceTaskRequest) GetStartNum ¶
func (x *PieceTaskRequest) GetStartNum() uint32
func (*PieceTaskRequest) GetTaskId ¶
func (x *PieceTaskRequest) GetTaskId() string
func (*PieceTaskRequest) ProtoMessage ¶
func (*PieceTaskRequest) ProtoMessage()
func (*PieceTaskRequest) ProtoReflect ¶
func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message
func (*PieceTaskRequest) Reset ¶
func (x *PieceTaskRequest) Reset()
func (*PieceTaskRequest) String ¶
func (x *PieceTaskRequest) String() string
func (*PieceTaskRequest) Validate ¶
func (m *PieceTaskRequest) Validate() error
Validate checks the field values on PieceTaskRequest 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 (*PieceTaskRequest) ValidateAll ¶
func (m *PieceTaskRequest) ValidateAll() error
ValidateAll checks the field values on PieceTaskRequest 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 PieceTaskRequestMultiError, or nil if none found.
type PieceTaskRequestMultiError ¶
type PieceTaskRequestMultiError []error
PieceTaskRequestMultiError is an error wrapping multiple validation errors returned by PieceTaskRequest.ValidateAll() if the designated constraints aren't met.
func (PieceTaskRequestMultiError) AllErrors ¶
func (m PieceTaskRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (PieceTaskRequestMultiError) Error ¶
func (m PieceTaskRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type PieceTaskRequestValidationError ¶
type PieceTaskRequestValidationError struct {
// contains filtered or unexported fields
}
PieceTaskRequestValidationError is the validation error returned by PieceTaskRequest.Validate if the designated constraints aren't met.
func (PieceTaskRequestValidationError) Cause ¶
func (e PieceTaskRequestValidationError) Cause() error
Cause function returns cause value.
func (PieceTaskRequestValidationError) Error ¶
func (e PieceTaskRequestValidationError) Error() string
Error satisfies the builtin error interface
func (PieceTaskRequestValidationError) ErrorName ¶
func (e PieceTaskRequestValidationError) ErrorName() string
ErrorName returns error name.
func (PieceTaskRequestValidationError) Field ¶
func (e PieceTaskRequestValidationError) Field() string
Field function returns field value.
func (PieceTaskRequestValidationError) Key ¶
func (e PieceTaskRequestValidationError) Key() bool
Key function returns key value.
func (PieceTaskRequestValidationError) Reason ¶
func (e PieceTaskRequestValidationError) Reason() string
Reason function returns reason value.
type Priority ¶
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 ¶
func (Priority) Descriptor() protoreflect.EnumDescriptor
func (Priority) EnumDescriptor
deprecated
func (Priority) Number ¶
func (x Priority) Number() protoreflect.EnumNumber
func (Priority) Type ¶
func (Priority) Type() protoreflect.EnumType
type SizeScope ¶
type SizeScope int32
SizeScope represents size scope of task.
const ( // NORMAL task has pieces is more than one piece. SizeScope_NORMAL SizeScope = 0 // SMALL task's content length is more than 128 byte and has only one piece. SizeScope_SMALL SizeScope = 1 // TINY task's content length is less than 128 byte. SizeScope_TINY SizeScope = 2 // EMPTY task's content length is equal to zero. SizeScope_EMPTY SizeScope = 3 // UNKNOW task has invalid size scope. SizeScope_UNKNOW SizeScope = 4 )
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 TaskType ¶
type TaskType int32
TaskType represents type of task.
const ( // Normal is normal type of task, // normal task is a normal p2p task. TaskType_Normal 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 UrlMeta ¶
type UrlMeta struct { // Digest checks integrity of url content, for example md5:xxx or sha256:yyy. Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` // URL tag identifies different task for same url, conflict with digest. Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` // Content range for url. Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` // Filter url used to generate task id. Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"` // Other url header infos. Header map[string]string `` /* 153-byte string literal not displayed */ // Application. Application string `protobuf:"bytes,6,opt,name=application,proto3" json:"application,omitempty"` // Priority. Priority Priority `protobuf:"varint,7,opt,name=priority,proto3,enum=common.Priority" json:"priority,omitempty"` // contains filtered or unexported fields }
UrlMeta describes url meta info.
func (*UrlMeta) Descriptor
deprecated
func (*UrlMeta) GetApplication ¶
func (*UrlMeta) GetPriority ¶
func (*UrlMeta) ProtoMessage ¶
func (*UrlMeta) ProtoMessage()
func (*UrlMeta) ProtoReflect ¶
func (x *UrlMeta) ProtoReflect() protoreflect.Message
func (*UrlMeta) Validate ¶
Validate checks the field values on UrlMeta 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 (*UrlMeta) ValidateAll ¶
ValidateAll checks the field values on UrlMeta 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 UrlMetaMultiError, or nil if none found.
type UrlMetaMultiError ¶
type UrlMetaMultiError []error
UrlMetaMultiError is an error wrapping multiple validation errors returned by UrlMeta.ValidateAll() if the designated constraints aren't met.
func (UrlMetaMultiError) AllErrors ¶
func (m UrlMetaMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UrlMetaMultiError) Error ¶
func (m UrlMetaMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UrlMetaValidationError ¶
type UrlMetaValidationError struct {
// contains filtered or unexported fields
}
UrlMetaValidationError is the validation error returned by UrlMeta.Validate if the designated constraints aren't met.
func (UrlMetaValidationError) Cause ¶
func (e UrlMetaValidationError) Cause() error
Cause function returns cause value.
func (UrlMetaValidationError) Error ¶
func (e UrlMetaValidationError) Error() string
Error satisfies the builtin error interface
func (UrlMetaValidationError) ErrorName ¶
func (e UrlMetaValidationError) ErrorName() string
ErrorName returns error name.
func (UrlMetaValidationError) Field ¶
func (e UrlMetaValidationError) Field() string
Field function returns field value.
func (UrlMetaValidationError) Key ¶
func (e UrlMetaValidationError) Key() bool
Key function returns key value.
func (UrlMetaValidationError) Reason ¶
func (e UrlMetaValidationError) Reason() string
Reason function returns reason value.