Documentation ¶
Index ¶
- Variables
- func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer)
- type AnnounceTaskRequest
- func (*AnnounceTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AnnounceTaskRequest) GetCid() string
- func (x *AnnounceTaskRequest) GetPeerHost() *PeerHost
- func (x *AnnounceTaskRequest) GetPiecePacket() *base.PiecePacket
- func (x *AnnounceTaskRequest) GetTaskId() string
- func (x *AnnounceTaskRequest) GetUrlMeta() *base.UrlMeta
- func (*AnnounceTaskRequest) ProtoMessage()
- func (x *AnnounceTaskRequest) ProtoReflect() protoreflect.Message
- func (x *AnnounceTaskRequest) Reset()
- func (x *AnnounceTaskRequest) String() string
- func (m *AnnounceTaskRequest) Validate() error
- type AnnounceTaskRequestValidationError
- func (e AnnounceTaskRequestValidationError) Cause() error
- func (e AnnounceTaskRequestValidationError) Error() string
- func (e AnnounceTaskRequestValidationError) ErrorName() string
- func (e AnnounceTaskRequestValidationError) Field() string
- func (e AnnounceTaskRequestValidationError) Key() bool
- func (e AnnounceTaskRequestValidationError) Reason() string
- type Pattern
- type PeerHost
- func (*PeerHost) Descriptor() ([]byte, []int)deprecated
- func (x *PeerHost) GetDownPort() int32
- func (x *PeerHost) GetHostName() string
- func (x *PeerHost) GetId() string
- func (x *PeerHost) GetIdc() string
- func (x *PeerHost) GetIp() string
- func (x *PeerHost) GetLocation() string
- func (x *PeerHost) GetNetTopology() string
- func (x *PeerHost) GetRpcPort() int32
- func (x *PeerHost) GetSecurityDomain() string
- func (*PeerHost) ProtoMessage()
- func (x *PeerHost) ProtoReflect() protoreflect.Message
- func (x *PeerHost) Reset()
- func (x *PeerHost) String() string
- func (m *PeerHost) Validate() error
- type PeerHostValidationError
- type PeerPacket
- func (*PeerPacket) Descriptor() ([]byte, []int)deprecated
- func (x *PeerPacket) GetCode() base.Code
- func (x *PeerPacket) GetMainPeer() *PeerPacket_DestPeer
- func (x *PeerPacket) GetParallelCount() int32
- func (x *PeerPacket) GetSrcPid() string
- func (x *PeerPacket) GetStealPeers() []*PeerPacket_DestPeer
- func (x *PeerPacket) GetTaskId() string
- func (*PeerPacket) ProtoMessage()
- func (x *PeerPacket) ProtoReflect() protoreflect.Message
- func (x *PeerPacket) Reset()
- func (x *PeerPacket) String() string
- func (m *PeerPacket) Validate() error
- type PeerPacketValidationError
- type PeerPacket_DestPeer
- func (*PeerPacket_DestPeer) Descriptor() ([]byte, []int)deprecated
- func (x *PeerPacket_DestPeer) GetIp() string
- func (x *PeerPacket_DestPeer) GetPeerId() string
- func (x *PeerPacket_DestPeer) GetRpcPort() int32
- func (*PeerPacket_DestPeer) ProtoMessage()
- func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message
- func (x *PeerPacket_DestPeer) Reset()
- func (x *PeerPacket_DestPeer) String() string
- func (m *PeerPacket_DestPeer) Validate() error
- type PeerPacket_DestPeerValidationError
- func (e PeerPacket_DestPeerValidationError) Cause() error
- func (e PeerPacket_DestPeerValidationError) Error() string
- func (e PeerPacket_DestPeerValidationError) ErrorName() string
- func (e PeerPacket_DestPeerValidationError) Field() string
- func (e PeerPacket_DestPeerValidationError) Key() bool
- func (e PeerPacket_DestPeerValidationError) Reason() string
- type PeerResult
- func (*PeerResult) Descriptor() ([]byte, []int)deprecated
- func (x *PeerResult) GetCode() base.Code
- func (x *PeerResult) GetContentLength() int64
- func (x *PeerResult) GetCost() uint32
- func (x *PeerResult) GetIdc() string
- func (x *PeerResult) GetPeerId() string
- func (x *PeerResult) GetSecurityDomain() string
- func (x *PeerResult) GetSrcIp() string
- func (x *PeerResult) GetSuccess() bool
- func (x *PeerResult) GetTaskId() string
- func (x *PeerResult) GetTotalPieceCount() int32
- func (x *PeerResult) GetTraffic() uint64
- func (x *PeerResult) GetUrl() string
- func (*PeerResult) ProtoMessage()
- func (x *PeerResult) ProtoReflect() protoreflect.Message
- func (x *PeerResult) Reset()
- func (x *PeerResult) String() string
- func (m *PeerResult) Validate() error
- type PeerResultValidationError
- type PeerTarget
- func (*PeerTarget) Descriptor() ([]byte, []int)deprecated
- func (x *PeerTarget) GetPeerId() string
- func (x *PeerTarget) GetTaskId() string
- func (*PeerTarget) ProtoMessage()
- func (x *PeerTarget) ProtoReflect() protoreflect.Message
- func (x *PeerTarget) Reset()
- func (x *PeerTarget) String() string
- func (m *PeerTarget) Validate() error
- type PeerTargetValidationError
- type PeerTaskRequest
- func (*PeerTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PeerTaskRequest) GetHostLoad() *base.HostLoad
- func (x *PeerTaskRequest) GetIsMigrating() bool
- func (x *PeerTaskRequest) GetPattern() Pattern
- func (x *PeerTaskRequest) GetPeerHost() *PeerHost
- func (x *PeerTaskRequest) GetPeerId() string
- func (x *PeerTaskRequest) GetTaskId() string
- func (x *PeerTaskRequest) GetUrl() string
- func (x *PeerTaskRequest) GetUrlMeta() *base.UrlMeta
- func (*PeerTaskRequest) ProtoMessage()
- func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message
- func (x *PeerTaskRequest) Reset()
- func (x *PeerTaskRequest) String() string
- func (m *PeerTaskRequest) Validate() error
- type PeerTaskRequestValidationError
- func (e PeerTaskRequestValidationError) Cause() error
- func (e PeerTaskRequestValidationError) Error() string
- func (e PeerTaskRequestValidationError) ErrorName() string
- func (e PeerTaskRequestValidationError) Field() string
- func (e PeerTaskRequestValidationError) Key() bool
- func (e PeerTaskRequestValidationError) Reason() string
- type PieceResult
- func (*PieceResult) Descriptor() ([]byte, []int)deprecated
- func (x *PieceResult) GetBeginTime() uint64
- func (x *PieceResult) GetCode() base.Code
- func (x *PieceResult) GetDstPid() string
- func (x *PieceResult) GetEndTime() uint64
- func (x *PieceResult) GetExtendAttribute() *base.ExtendAttribute
- func (x *PieceResult) GetFinishedCount() int32
- func (x *PieceResult) GetHostLoad() *base.HostLoad
- func (x *PieceResult) GetPieceInfo() *base.PieceInfo
- func (x *PieceResult) GetSrcPid() string
- func (x *PieceResult) GetSuccess() bool
- func (x *PieceResult) GetTaskId() string
- func (*PieceResult) ProtoMessage()
- func (x *PieceResult) ProtoReflect() protoreflect.Message
- func (x *PieceResult) Reset()
- func (x *PieceResult) String() string
- func (m *PieceResult) Validate() error
- type PieceResultValidationError
- func (e PieceResultValidationError) Cause() error
- func (e PieceResultValidationError) Error() string
- func (e PieceResultValidationError) ErrorName() string
- func (e PieceResultValidationError) Field() string
- func (e PieceResultValidationError) Key() bool
- func (e PieceResultValidationError) Reason() string
- type RegisterResult
- func (*RegisterResult) Descriptor() ([]byte, []int)deprecated
- func (m *RegisterResult) GetDirectPiece() isRegisterResult_DirectPiece
- func (x *RegisterResult) GetExtendAttribute() *base.ExtendAttribute
- func (x *RegisterResult) GetPieceContent() []byte
- func (x *RegisterResult) GetSinglePiece() *SinglePiece
- func (x *RegisterResult) GetSizeScope() base.SizeScope
- func (x *RegisterResult) GetTaskId() string
- func (x *RegisterResult) GetTaskType() int32
- func (*RegisterResult) ProtoMessage()
- func (x *RegisterResult) ProtoReflect() protoreflect.Message
- func (x *RegisterResult) Reset()
- func (x *RegisterResult) String() string
- func (m *RegisterResult) Validate() error
- type RegisterResultValidationError
- func (e RegisterResultValidationError) Cause() error
- func (e RegisterResultValidationError) Error() string
- func (e RegisterResultValidationError) ErrorName() string
- func (e RegisterResultValidationError) Field() string
- func (e RegisterResultValidationError) Key() bool
- func (e RegisterResultValidationError) Reason() string
- type RegisterResult_PieceContent
- type RegisterResult_SinglePiece
- type SchedulerClient
- type SchedulerServer
- type Scheduler_ReportPieceResultClient
- type Scheduler_ReportPieceResultServer
- type SinglePiece
- func (*SinglePiece) Descriptor() ([]byte, []int)deprecated
- func (x *SinglePiece) GetDstAddr() string
- func (x *SinglePiece) GetDstPid() string
- func (x *SinglePiece) GetPieceInfo() *base.PieceInfo
- func (*SinglePiece) ProtoMessage()
- func (x *SinglePiece) ProtoReflect() protoreflect.Message
- func (x *SinglePiece) Reset()
- func (x *SinglePiece) String() string
- func (m *SinglePiece) Validate() error
- type SinglePieceValidationError
- func (e SinglePieceValidationError) Cause() error
- func (e SinglePieceValidationError) Error() string
- func (e SinglePieceValidationError) ErrorName() string
- func (e SinglePieceValidationError) Field() string
- func (e SinglePieceValidationError) Key() bool
- func (e SinglePieceValidationError) Reason() string
- type StatTaskRequest
- func (*StatTaskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StatTaskRequest) GetTaskId() string
- func (*StatTaskRequest) ProtoMessage()
- func (x *StatTaskRequest) ProtoReflect() protoreflect.Message
- func (x *StatTaskRequest) Reset()
- func (x *StatTaskRequest) String() string
- func (m *StatTaskRequest) Validate() error
- type StatTaskRequestValidationError
- func (e StatTaskRequestValidationError) Cause() error
- func (e StatTaskRequestValidationError) Error() string
- func (e StatTaskRequestValidationError) ErrorName() string
- func (e StatTaskRequestValidationError) Field() string
- func (e StatTaskRequestValidationError) Key() bool
- func (e StatTaskRequestValidationError) Reason() string
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetContentLength() int64
- func (x *Task) GetHasAvailablePeer() bool
- func (x *Task) GetId() string
- func (x *Task) GetPeerCount() int32
- func (x *Task) GetState() string
- func (x *Task) GetTotalPieceCount() int32
- func (x *Task) GetType() int32
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- func (m *Task) Validate() error
- type TaskValidationError
- type UnimplementedSchedulerServer
- func (*UnimplementedSchedulerServer) AnnounceTask(context.Context, *AnnounceTaskRequest) (*emptypb.Empty, error)
- func (*UnimplementedSchedulerServer) LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error)
- func (*UnimplementedSchedulerServer) RegisterPeerTask(context.Context, *PeerTaskRequest) (*RegisterResult, error)
- func (*UnimplementedSchedulerServer) ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error)
- func (*UnimplementedSchedulerServer) ReportPieceResult(Scheduler_ReportPieceResultServer) error
- func (*UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*Task, error)
Constants ¶
This section is empty.
Variables ¶
var ( Pattern_name = map[int32]string{ 0: "P2P", 1: "SEED_PEER", 2: "SOURCE", } Pattern_value = map[string]int32{ "P2P": 0, "SEED_PEER": 1, "SOURCE": 2, } )
Enum value maps for Pattern.
var File_pkg_rpc_scheduler_scheduler_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSchedulerServer ¶
func RegisterSchedulerServer(s *grpc.Server, srv SchedulerServer)
Types ¶
type AnnounceTaskRequest ¶ added in v2.0.3
type AnnounceTaskRequest struct { // Task id. TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Cache id. Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` // URL meta info. UrlMeta *base.UrlMeta `protobuf:"bytes,3,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"` // Peer host info. PeerHost *PeerHost `protobuf:"bytes,4,opt,name=peer_host,json=peerHost,proto3" json:"peer_host,omitempty"` // Task piece info. PiecePacket *base.PiecePacket `protobuf:"bytes,5,opt,name=piece_packet,json=piecePacket,proto3" json:"piece_packet,omitempty"` // contains filtered or unexported fields }
AnnounceTaskRequest represents request of AnnounceTask.
func (*AnnounceTaskRequest) Descriptor
deprecated
added in
v2.0.3
func (*AnnounceTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use AnnounceTaskRequest.ProtoReflect.Descriptor instead.
func (*AnnounceTaskRequest) GetCid ¶ added in v2.0.3
func (x *AnnounceTaskRequest) GetCid() string
func (*AnnounceTaskRequest) GetPeerHost ¶ added in v2.0.3
func (x *AnnounceTaskRequest) GetPeerHost() *PeerHost
func (*AnnounceTaskRequest) GetPiecePacket ¶ added in v2.0.3
func (x *AnnounceTaskRequest) GetPiecePacket() *base.PiecePacket
func (*AnnounceTaskRequest) GetTaskId ¶ added in v2.0.3
func (x *AnnounceTaskRequest) GetTaskId() string
func (*AnnounceTaskRequest) GetUrlMeta ¶ added in v2.0.3
func (x *AnnounceTaskRequest) GetUrlMeta() *base.UrlMeta
func (*AnnounceTaskRequest) ProtoMessage ¶ added in v2.0.3
func (*AnnounceTaskRequest) ProtoMessage()
func (*AnnounceTaskRequest) ProtoReflect ¶ added in v2.0.3
func (x *AnnounceTaskRequest) ProtoReflect() protoreflect.Message
func (*AnnounceTaskRequest) Reset ¶ added in v2.0.3
func (x *AnnounceTaskRequest) Reset()
func (*AnnounceTaskRequest) String ¶ added in v2.0.3
func (x *AnnounceTaskRequest) String() string
func (*AnnounceTaskRequest) Validate ¶ added in v2.0.3
func (m *AnnounceTaskRequest) Validate() error
Validate checks the field values on AnnounceTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type AnnounceTaskRequestValidationError ¶ added in v2.0.3
type AnnounceTaskRequestValidationError struct {
// contains filtered or unexported fields
}
AnnounceTaskRequestValidationError is the validation error returned by AnnounceTaskRequest.Validate if the designated constraints aren't met.
func (AnnounceTaskRequestValidationError) Cause ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) Cause() error
Cause function returns cause value.
func (AnnounceTaskRequestValidationError) Error ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) Error() string
Error satisfies the builtin error interface
func (AnnounceTaskRequestValidationError) ErrorName ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) ErrorName() string
ErrorName returns error name.
func (AnnounceTaskRequestValidationError) Field ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) Field() string
Field function returns field value.
func (AnnounceTaskRequestValidationError) Key ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) Key() bool
Key function returns key value.
func (AnnounceTaskRequestValidationError) Reason ¶ added in v2.0.3
func (e AnnounceTaskRequestValidationError) Reason() string
Reason function returns reason value.
type Pattern ¶ added in v2.0.3
type Pattern int32
Pattern represents pattern of task.
const ( // Default pattern, scheduler will use all p2p node // include dfdaemon and seed peers. Pattern_P2P Pattern = 0 // Seed peer pattern, scheduler will use only seed peers. Pattern_SEED_PEER Pattern = 1 // Source pattern, scheduler will say back source // when there is no available peer in p2p. Pattern_SOURCE Pattern = 2 )
func (Pattern) Descriptor ¶ added in v2.0.3
func (Pattern) Descriptor() protoreflect.EnumDescriptor
func (Pattern) EnumDescriptor
deprecated
added in
v2.0.3
func (Pattern) Number ¶ added in v2.0.3
func (x Pattern) Number() protoreflect.EnumNumber
func (Pattern) Type ¶ added in v2.0.3
func (Pattern) Type() protoreflect.EnumType
type PeerHost ¶
type PeerHost struct { // Peer host id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // peer host ip Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` // Port of grpc service. RpcPort int32 `protobuf:"varint,3,opt,name=rpc_port,json=rpcPort,proto3" json:"rpc_port,omitempty"` // Port of download server. DownPort int32 `protobuf:"varint,4,opt,name=down_port,json=downPort,proto3" json:"down_port,omitempty"` // Peer hostname. HostName string `protobuf:"bytes,5,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"` // Security domain for network. SecurityDomain string `protobuf:"bytes,6,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"` // Location path(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"` // Network topology(switch|router|...). NetTopology string `protobuf:"bytes,9,opt,name=net_topology,json=netTopology,proto3" json:"net_topology,omitempty"` // contains filtered or unexported fields }
PeerHost represents infomation of peer host.
func (*PeerHost) Descriptor
deprecated
func (*PeerHost) GetDownPort ¶
func (*PeerHost) GetHostName ¶
func (*PeerHost) GetLocation ¶
func (*PeerHost) GetNetTopology ¶
func (*PeerHost) GetRpcPort ¶
func (*PeerHost) GetSecurityDomain ¶
func (*PeerHost) ProtoMessage ¶
func (*PeerHost) ProtoMessage()
func (*PeerHost) ProtoReflect ¶
func (x *PeerHost) ProtoReflect() protoreflect.Message
type PeerHostValidationError ¶
type PeerHostValidationError struct {
// contains filtered or unexported fields
}
PeerHostValidationError is the validation error returned by PeerHost.Validate if the designated constraints aren't met.
func (PeerHostValidationError) Cause ¶
func (e PeerHostValidationError) Cause() error
Cause function returns cause value.
func (PeerHostValidationError) Error ¶
func (e PeerHostValidationError) Error() string
Error satisfies the builtin error interface
func (PeerHostValidationError) ErrorName ¶
func (e PeerHostValidationError) ErrorName() string
ErrorName returns error name.
func (PeerHostValidationError) Field ¶
func (e PeerHostValidationError) Field() string
Field function returns field value.
func (PeerHostValidationError) Key ¶
func (e PeerHostValidationError) Key() bool
Key function returns key value.
func (PeerHostValidationError) Reason ¶
func (e PeerHostValidationError) Reason() string
Reason function returns reason value.
type PeerPacket ¶
type PeerPacket struct { // Task id. TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Source peer id. SrcPid string `protobuf:"bytes,3,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"` // Concurrent downloading count from main peer. ParallelCount int32 `protobuf:"varint,4,opt,name=parallel_count,json=parallelCount,proto3" json:"parallel_count,omitempty"` // Main peer. MainPeer *PeerPacket_DestPeer `protobuf:"bytes,5,opt,name=main_peer,json=mainPeer,proto3" json:"main_peer,omitempty"` // Steal peers. StealPeers []*PeerPacket_DestPeer `protobuf:"bytes,6,rep,name=steal_peers,json=stealPeers,proto3" json:"steal_peers,omitempty"` // Result code. Code base.Code `protobuf:"varint,7,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"` // contains filtered or unexported fields }
PeerPacket represents response of ReportPieceResult.
func (*PeerPacket) Descriptor
deprecated
func (*PeerPacket) Descriptor() ([]byte, []int)
Deprecated: Use PeerPacket.ProtoReflect.Descriptor instead.
func (*PeerPacket) GetCode ¶
func (x *PeerPacket) GetCode() base.Code
func (*PeerPacket) GetMainPeer ¶
func (x *PeerPacket) GetMainPeer() *PeerPacket_DestPeer
func (*PeerPacket) GetParallelCount ¶
func (x *PeerPacket) GetParallelCount() int32
func (*PeerPacket) GetSrcPid ¶
func (x *PeerPacket) GetSrcPid() string
func (*PeerPacket) GetStealPeers ¶
func (x *PeerPacket) GetStealPeers() []*PeerPacket_DestPeer
func (*PeerPacket) GetTaskId ¶
func (x *PeerPacket) GetTaskId() string
func (*PeerPacket) ProtoMessage ¶
func (*PeerPacket) ProtoMessage()
func (*PeerPacket) ProtoReflect ¶
func (x *PeerPacket) ProtoReflect() protoreflect.Message
func (*PeerPacket) Reset ¶
func (x *PeerPacket) Reset()
func (*PeerPacket) String ¶
func (x *PeerPacket) String() string
func (*PeerPacket) Validate ¶
func (m *PeerPacket) Validate() error
Validate checks the field values on PeerPacket with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PeerPacketValidationError ¶
type PeerPacketValidationError struct {
// contains filtered or unexported fields
}
PeerPacketValidationError is the validation error returned by PeerPacket.Validate if the designated constraints aren't met.
func (PeerPacketValidationError) Cause ¶
func (e PeerPacketValidationError) Cause() error
Cause function returns cause value.
func (PeerPacketValidationError) Error ¶
func (e PeerPacketValidationError) Error() string
Error satisfies the builtin error interface
func (PeerPacketValidationError) ErrorName ¶
func (e PeerPacketValidationError) ErrorName() string
ErrorName returns error name.
func (PeerPacketValidationError) Field ¶
func (e PeerPacketValidationError) Field() string
Field function returns field value.
func (PeerPacketValidationError) Key ¶
func (e PeerPacketValidationError) Key() bool
Key function returns key value.
func (PeerPacketValidationError) Reason ¶
func (e PeerPacketValidationError) Reason() string
Reason function returns reason value.
type PeerPacket_DestPeer ¶
type PeerPacket_DestPeer struct { // Destination ip. Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // Port of grpc service. RpcPort int32 `protobuf:"varint,2,opt,name=rpc_port,json=rpcPort,proto3" json:"rpc_port,omitempty"` // Destination peer id. PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // contains filtered or unexported fields }
func (*PeerPacket_DestPeer) Descriptor
deprecated
func (*PeerPacket_DestPeer) Descriptor() ([]byte, []int)
Deprecated: Use PeerPacket_DestPeer.ProtoReflect.Descriptor instead.
func (*PeerPacket_DestPeer) GetIp ¶
func (x *PeerPacket_DestPeer) GetIp() string
func (*PeerPacket_DestPeer) GetPeerId ¶
func (x *PeerPacket_DestPeer) GetPeerId() string
func (*PeerPacket_DestPeer) GetRpcPort ¶
func (x *PeerPacket_DestPeer) GetRpcPort() int32
func (*PeerPacket_DestPeer) ProtoMessage ¶
func (*PeerPacket_DestPeer) ProtoMessage()
func (*PeerPacket_DestPeer) ProtoReflect ¶
func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message
func (*PeerPacket_DestPeer) Reset ¶
func (x *PeerPacket_DestPeer) Reset()
func (*PeerPacket_DestPeer) String ¶
func (x *PeerPacket_DestPeer) String() string
func (*PeerPacket_DestPeer) Validate ¶
func (m *PeerPacket_DestPeer) Validate() error
Validate checks the field values on PeerPacket_DestPeer with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PeerPacket_DestPeerValidationError ¶
type PeerPacket_DestPeerValidationError struct {
// contains filtered or unexported fields
}
PeerPacket_DestPeerValidationError is the validation error returned by PeerPacket_DestPeer.Validate if the designated constraints aren't met.
func (PeerPacket_DestPeerValidationError) Cause ¶
func (e PeerPacket_DestPeerValidationError) Cause() error
Cause function returns cause value.
func (PeerPacket_DestPeerValidationError) Error ¶
func (e PeerPacket_DestPeerValidationError) Error() string
Error satisfies the builtin error interface
func (PeerPacket_DestPeerValidationError) ErrorName ¶
func (e PeerPacket_DestPeerValidationError) ErrorName() string
ErrorName returns error name.
func (PeerPacket_DestPeerValidationError) Field ¶
func (e PeerPacket_DestPeerValidationError) Field() string
Field function returns field value.
func (PeerPacket_DestPeerValidationError) Key ¶
func (e PeerPacket_DestPeerValidationError) Key() bool
Key function returns key value.
func (PeerPacket_DestPeerValidationError) Reason ¶
func (e PeerPacket_DestPeerValidationError) Reason() string
Reason function returns reason value.
type PeerResult ¶
type PeerResult struct { // Task id. TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Peer id. PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // Source host ip. SrcIp string `protobuf:"bytes,3,opt,name=src_ip,json=srcIp,proto3" json:"src_ip,omitempty"` // Security domain. SecurityDomain string `protobuf:"bytes,4,opt,name=security_domain,json=securityDomain,proto3" json:"security_domain,omitempty"` // IDC where the peer host is located Idc string `protobuf:"bytes,5,opt,name=idc,proto3" json:"idc,omitempty"` // Download url. Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"` // Total content length. ContentLength int64 `protobuf:"varint,7,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"` // Total network traffic. Traffic uint64 `protobuf:"varint,8,opt,name=traffic,proto3" json:"traffic,omitempty"` // Total cost time. Cost uint32 `protobuf:"varint,9,opt,name=cost,proto3" json:"cost,omitempty"` // Whether peer downloading file is successfully. Success bool `protobuf:"varint,10,opt,name=success,proto3" json:"success,omitempty"` // Result code. Code base.Code `protobuf:"varint,11,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"` // Task total piece count. TotalPieceCount int32 `protobuf:"varint,12,opt,name=total_piece_count,json=totalPieceCount,proto3" json:"total_piece_count,omitempty"` // contains filtered or unexported fields }
PeerResult represents response of ReportPeerResult.
func (*PeerResult) Descriptor
deprecated
func (*PeerResult) Descriptor() ([]byte, []int)
Deprecated: Use PeerResult.ProtoReflect.Descriptor instead.
func (*PeerResult) GetCode ¶
func (x *PeerResult) GetCode() base.Code
func (*PeerResult) GetContentLength ¶
func (x *PeerResult) GetContentLength() int64
func (*PeerResult) GetCost ¶
func (x *PeerResult) GetCost() uint32
func (*PeerResult) GetIdc ¶
func (x *PeerResult) GetIdc() string
func (*PeerResult) GetPeerId ¶
func (x *PeerResult) GetPeerId() string
func (*PeerResult) GetSecurityDomain ¶
func (x *PeerResult) GetSecurityDomain() string
func (*PeerResult) GetSrcIp ¶
func (x *PeerResult) GetSrcIp() string
func (*PeerResult) GetSuccess ¶
func (x *PeerResult) GetSuccess() bool
func (*PeerResult) GetTaskId ¶
func (x *PeerResult) GetTaskId() string
func (*PeerResult) GetTotalPieceCount ¶
func (x *PeerResult) GetTotalPieceCount() int32
func (*PeerResult) GetTraffic ¶
func (x *PeerResult) GetTraffic() uint64
func (*PeerResult) GetUrl ¶
func (x *PeerResult) GetUrl() string
func (*PeerResult) ProtoMessage ¶
func (*PeerResult) ProtoMessage()
func (*PeerResult) ProtoReflect ¶
func (x *PeerResult) ProtoReflect() protoreflect.Message
func (*PeerResult) Reset ¶
func (x *PeerResult) Reset()
func (*PeerResult) String ¶
func (x *PeerResult) String() string
func (*PeerResult) Validate ¶
func (m *PeerResult) Validate() error
Validate checks the field values on PeerResult with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PeerResultValidationError ¶
type PeerResultValidationError struct {
// contains filtered or unexported fields
}
PeerResultValidationError is the validation error returned by PeerResult.Validate if the designated constraints aren't met.
func (PeerResultValidationError) Cause ¶
func (e PeerResultValidationError) Cause() error
Cause function returns cause value.
func (PeerResultValidationError) Error ¶
func (e PeerResultValidationError) Error() string
Error satisfies the builtin error interface
func (PeerResultValidationError) ErrorName ¶
func (e PeerResultValidationError) ErrorName() string
ErrorName returns error name.
func (PeerResultValidationError) Field ¶
func (e PeerResultValidationError) Field() string
Field function returns field value.
func (PeerResultValidationError) Key ¶
func (e PeerResultValidationError) Key() bool
Key function returns key value.
func (PeerResultValidationError) Reason ¶
func (e PeerResultValidationError) Reason() string
Reason function returns reason value.
type PeerTarget ¶
type PeerTarget struct { // Task id. TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Peer id. PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // contains filtered or unexported fields }
PeerTarget represents request of LeaveTask.
func (*PeerTarget) Descriptor
deprecated
func (*PeerTarget) Descriptor() ([]byte, []int)
Deprecated: Use PeerTarget.ProtoReflect.Descriptor instead.
func (*PeerTarget) GetPeerId ¶
func (x *PeerTarget) GetPeerId() string
func (*PeerTarget) GetTaskId ¶
func (x *PeerTarget) GetTaskId() string
func (*PeerTarget) ProtoMessage ¶
func (*PeerTarget) ProtoMessage()
func (*PeerTarget) ProtoReflect ¶
func (x *PeerTarget) ProtoReflect() protoreflect.Message
func (*PeerTarget) Reset ¶
func (x *PeerTarget) Reset()
func (*PeerTarget) String ¶
func (x *PeerTarget) String() string
func (*PeerTarget) Validate ¶
func (m *PeerTarget) Validate() error
Validate checks the field values on PeerTarget with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PeerTargetValidationError ¶
type PeerTargetValidationError struct {
// contains filtered or unexported fields
}
PeerTargetValidationError is the validation error returned by PeerTarget.Validate if the designated constraints aren't met.
func (PeerTargetValidationError) Cause ¶
func (e PeerTargetValidationError) Cause() error
Cause function returns cause value.
func (PeerTargetValidationError) Error ¶
func (e PeerTargetValidationError) Error() string
Error satisfies the builtin error interface
func (PeerTargetValidationError) ErrorName ¶
func (e PeerTargetValidationError) ErrorName() string
ErrorName returns error name.
func (PeerTargetValidationError) Field ¶
func (e PeerTargetValidationError) Field() string
Field function returns field value.
func (PeerTargetValidationError) Key ¶
func (e PeerTargetValidationError) Key() bool
Key function returns key value.
func (PeerTargetValidationError) Reason ¶
func (e PeerTargetValidationError) Reason() string
Reason function returns reason value.
type PeerTaskRequest ¶
type PeerTaskRequest struct { // Download url. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // URL meta info. UrlMeta *base.UrlMeta `protobuf:"bytes,2,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"` // Peer id and it must be global uniqueness. PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` // Peer host info. PeerHost *PeerHost `protobuf:"bytes,4,opt,name=peer_host,json=peerHost,proto3" json:"peer_host,omitempty"` // Peer host load. HostLoad *base.HostLoad `protobuf:"bytes,5,opt,name=host_load,json=hostLoad,proto3" json:"host_load,omitempty"` // Whether this request is caused by migration. IsMigrating bool `protobuf:"varint,6,opt,name=is_migrating,json=isMigrating,proto3" json:"is_migrating,omitempty"` // Pattern includes p2p, seed-peer and source. Pattern Pattern `protobuf:"varint,7,opt,name=pattern,proto3,enum=scheduler.Pattern" json:"pattern,omitempty"` // Task id. TaskId string `protobuf:"bytes,8,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // contains filtered or unexported fields }
PeerTaskRequest represents request of RegisterPeerTask.
func (*PeerTaskRequest) Descriptor
deprecated
func (*PeerTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeerTaskRequest.ProtoReflect.Descriptor instead.
func (*PeerTaskRequest) GetHostLoad ¶
func (x *PeerTaskRequest) GetHostLoad() *base.HostLoad
func (*PeerTaskRequest) GetIsMigrating ¶
func (x *PeerTaskRequest) GetIsMigrating() bool
func (*PeerTaskRequest) GetPattern ¶ added in v2.0.3
func (x *PeerTaskRequest) GetPattern() Pattern
func (*PeerTaskRequest) GetPeerHost ¶
func (x *PeerTaskRequest) GetPeerHost() *PeerHost
func (*PeerTaskRequest) GetPeerId ¶
func (x *PeerTaskRequest) GetPeerId() string
func (*PeerTaskRequest) GetTaskId ¶ added in v2.0.3
func (x *PeerTaskRequest) GetTaskId() string
func (*PeerTaskRequest) GetUrl ¶
func (x *PeerTaskRequest) GetUrl() string
func (*PeerTaskRequest) GetUrlMeta ¶
func (x *PeerTaskRequest) GetUrlMeta() *base.UrlMeta
func (*PeerTaskRequest) ProtoMessage ¶
func (*PeerTaskRequest) ProtoMessage()
func (*PeerTaskRequest) ProtoReflect ¶
func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message
func (*PeerTaskRequest) Reset ¶
func (x *PeerTaskRequest) Reset()
func (*PeerTaskRequest) String ¶
func (x *PeerTaskRequest) String() string
func (*PeerTaskRequest) Validate ¶
func (m *PeerTaskRequest) Validate() error
Validate checks the field values on PeerTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PeerTaskRequestValidationError ¶
type PeerTaskRequestValidationError struct {
// contains filtered or unexported fields
}
PeerTaskRequestValidationError is the validation error returned by PeerTaskRequest.Validate if the designated constraints aren't met.
func (PeerTaskRequestValidationError) Cause ¶
func (e PeerTaskRequestValidationError) Cause() error
Cause function returns cause value.
func (PeerTaskRequestValidationError) Error ¶
func (e PeerTaskRequestValidationError) Error() string
Error satisfies the builtin error interface
func (PeerTaskRequestValidationError) ErrorName ¶
func (e PeerTaskRequestValidationError) ErrorName() string
ErrorName returns error name.
func (PeerTaskRequestValidationError) Field ¶
func (e PeerTaskRequestValidationError) Field() string
Field function returns field value.
func (PeerTaskRequestValidationError) Key ¶
func (e PeerTaskRequestValidationError) Key() bool
Key function returns key value.
func (PeerTaskRequestValidationError) Reason ¶
func (e PeerTaskRequestValidationError) Reason() string
Reason function returns reason value.
type PieceResult ¶
type PieceResult struct { // Task id. TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Source peer id. SrcPid string `protobuf:"bytes,2,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"` // Destination peer id. DstPid string `protobuf:"bytes,3,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"` // Piece info. PieceInfo *base.PieceInfo `protobuf:"bytes,4,opt,name=piece_info,json=pieceInfo,proto3" json:"piece_info,omitempty"` // Begin time of the piece downloading. BeginTime uint64 `protobuf:"varint,5,opt,name=begin_time,json=beginTime,proto3" json:"begin_time,omitempty"` // End time of the piece downloading. EndTime uint64 `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // Whether the piece downloading is successfully. Success bool `protobuf:"varint,7,opt,name=success,proto3" json:"success,omitempty"` // Result code. Code base.Code `protobuf:"varint,8,opt,name=code,proto3,enum=base.Code" json:"code,omitempty"` // Peer host load. HostLoad *base.HostLoad `protobuf:"bytes,9,opt,name=host_load,json=hostLoad,proto3" json:"host_load,omitempty"` // Finished count. FinishedCount int32 `protobuf:"varint,10,opt,name=finished_count,json=finishedCount,proto3" json:"finished_count,omitempty"` // Task extend attribute, // only first success back source piece will carry extend attribute. ExtendAttribute *base.ExtendAttribute `protobuf:"bytes,11,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"` // contains filtered or unexported fields }
PieceResult represents request of ReportPieceResult.
func (*PieceResult) Descriptor
deprecated
func (*PieceResult) Descriptor() ([]byte, []int)
Deprecated: Use PieceResult.ProtoReflect.Descriptor instead.
func (*PieceResult) GetBeginTime ¶
func (x *PieceResult) GetBeginTime() uint64
func (*PieceResult) GetCode ¶
func (x *PieceResult) GetCode() base.Code
func (*PieceResult) GetDstPid ¶
func (x *PieceResult) GetDstPid() string
func (*PieceResult) GetEndTime ¶
func (x *PieceResult) GetEndTime() uint64
func (*PieceResult) GetExtendAttribute ¶ added in v2.0.3
func (x *PieceResult) GetExtendAttribute() *base.ExtendAttribute
func (*PieceResult) GetFinishedCount ¶
func (x *PieceResult) GetFinishedCount() int32
func (*PieceResult) GetHostLoad ¶
func (x *PieceResult) GetHostLoad() *base.HostLoad
func (*PieceResult) GetPieceInfo ¶
func (x *PieceResult) GetPieceInfo() *base.PieceInfo
func (*PieceResult) GetSrcPid ¶
func (x *PieceResult) GetSrcPid() string
func (*PieceResult) GetSuccess ¶
func (x *PieceResult) GetSuccess() bool
func (*PieceResult) GetTaskId ¶
func (x *PieceResult) GetTaskId() string
func (*PieceResult) ProtoMessage ¶
func (*PieceResult) ProtoMessage()
func (*PieceResult) ProtoReflect ¶
func (x *PieceResult) ProtoReflect() protoreflect.Message
func (*PieceResult) Reset ¶
func (x *PieceResult) Reset()
func (*PieceResult) String ¶
func (x *PieceResult) String() string
func (*PieceResult) Validate ¶
func (m *PieceResult) Validate() error
Validate checks the field values on PieceResult with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type PieceResultValidationError ¶
type PieceResultValidationError struct {
// contains filtered or unexported fields
}
PieceResultValidationError is the validation error returned by PieceResult.Validate if the designated constraints aren't met.
func (PieceResultValidationError) Cause ¶
func (e PieceResultValidationError) Cause() error
Cause function returns cause value.
func (PieceResultValidationError) Error ¶
func (e PieceResultValidationError) Error() string
Error satisfies the builtin error interface
func (PieceResultValidationError) ErrorName ¶
func (e PieceResultValidationError) ErrorName() string
ErrorName returns error name.
func (PieceResultValidationError) Field ¶
func (e PieceResultValidationError) Field() string
Field function returns field value.
func (PieceResultValidationError) Key ¶
func (e PieceResultValidationError) Key() bool
Key function returns key value.
func (PieceResultValidationError) Reason ¶
func (e PieceResultValidationError) Reason() string
Reason function returns reason value.
type RegisterResult ¶
type RegisterResult struct { // Task type TaskType int32 `protobuf:"varint,1,opt,name=task_type,json=taskType,proto3" json:"task_type,omitempty"` // Task id TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // File size scope. SizeScope base.SizeScope `protobuf:"varint,3,opt,name=size_scope,json=sizeScope,proto3,enum=base.SizeScope" json:"size_scope,omitempty"` // Download the only piece directly for small or tiny file. // // Types that are assignable to DirectPiece: // *RegisterResult_SinglePiece // *RegisterResult_PieceContent DirectPiece isRegisterResult_DirectPiece `protobuf_oneof:"direct_piece"` // Task extend attribute, // only direct_piece will carry extend attribute. ExtendAttribute *base.ExtendAttribute `protobuf:"bytes,6,opt,name=extend_attribute,json=extendAttribute,proto3" json:"extend_attribute,omitempty"` // contains filtered or unexported fields }
RegisterResult represents response of RegisterPeerTask.
func (*RegisterResult) Descriptor
deprecated
func (*RegisterResult) Descriptor() ([]byte, []int)
Deprecated: Use RegisterResult.ProtoReflect.Descriptor instead.
func (*RegisterResult) GetDirectPiece ¶
func (m *RegisterResult) GetDirectPiece() isRegisterResult_DirectPiece
func (*RegisterResult) GetExtendAttribute ¶ added in v2.0.3
func (x *RegisterResult) GetExtendAttribute() *base.ExtendAttribute
func (*RegisterResult) GetPieceContent ¶
func (x *RegisterResult) GetPieceContent() []byte
func (*RegisterResult) GetSinglePiece ¶
func (x *RegisterResult) GetSinglePiece() *SinglePiece
func (*RegisterResult) GetSizeScope ¶
func (x *RegisterResult) GetSizeScope() base.SizeScope
func (*RegisterResult) GetTaskId ¶
func (x *RegisterResult) GetTaskId() string
func (*RegisterResult) GetTaskType ¶ added in v2.0.3
func (x *RegisterResult) GetTaskType() int32
func (*RegisterResult) ProtoMessage ¶
func (*RegisterResult) ProtoMessage()
func (*RegisterResult) ProtoReflect ¶
func (x *RegisterResult) ProtoReflect() protoreflect.Message
func (*RegisterResult) Reset ¶
func (x *RegisterResult) Reset()
func (*RegisterResult) String ¶
func (x *RegisterResult) String() string
func (*RegisterResult) Validate ¶
func (m *RegisterResult) Validate() error
Validate checks the field values on RegisterResult with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type RegisterResultValidationError ¶
type RegisterResultValidationError struct {
// contains filtered or unexported fields
}
RegisterResultValidationError is the validation error returned by RegisterResult.Validate if the designated constraints aren't met.
func (RegisterResultValidationError) Cause ¶
func (e RegisterResultValidationError) Cause() error
Cause function returns cause value.
func (RegisterResultValidationError) Error ¶
func (e RegisterResultValidationError) Error() string
Error satisfies the builtin error interface
func (RegisterResultValidationError) ErrorName ¶
func (e RegisterResultValidationError) ErrorName() string
ErrorName returns error name.
func (RegisterResultValidationError) Field ¶
func (e RegisterResultValidationError) Field() string
Field function returns field value.
func (RegisterResultValidationError) Key ¶
func (e RegisterResultValidationError) Key() bool
Key function returns key value.
func (RegisterResultValidationError) Reason ¶
func (e RegisterResultValidationError) Reason() string
Reason function returns reason value.
type RegisterResult_PieceContent ¶
type RegisterResult_PieceContent struct { // Return task content when size scope is tiny. PieceContent []byte `protobuf:"bytes,5,opt,name=piece_content,json=pieceContent,proto3,oneof"` }
type RegisterResult_SinglePiece ¶
type RegisterResult_SinglePiece struct { // Return single piece info when size scope is small. SinglePiece *SinglePiece `protobuf:"bytes,4,opt,name=single_piece,json=singlePiece,proto3,oneof"` }
type SchedulerClient ¶
type SchedulerClient interface { // RegisterPeerTask registers a peer into task. RegisterPeerTask(ctx context.Context, in *PeerTaskRequest, opts ...grpc.CallOption) (*RegisterResult, error) // ReportPieceResult reports piece results and receives peer packets. ReportPieceResult(ctx context.Context, opts ...grpc.CallOption) (Scheduler_ReportPieceResultClient, error) // ReportPeerResult reports downloading result for the peer. ReportPeerResult(ctx context.Context, in *PeerResult, opts ...grpc.CallOption) (*emptypb.Empty, error) // LeaveTask makes the peer leaving from task. LeaveTask(ctx context.Context, in *PeerTarget, opts ...grpc.CallOption) (*emptypb.Empty, error) // Checks if any peer has the given task. StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*Task, error) // A peer announces that it has the announced task to other peers. AnnounceTask(ctx context.Context, in *AnnounceTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
SchedulerClient is the client API for Scheduler service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSchedulerClient ¶
func NewSchedulerClient(cc grpc.ClientConnInterface) SchedulerClient
type SchedulerServer ¶
type SchedulerServer interface { // RegisterPeerTask registers a peer into task. RegisterPeerTask(context.Context, *PeerTaskRequest) (*RegisterResult, error) // ReportPieceResult reports piece results and receives peer packets. ReportPieceResult(Scheduler_ReportPieceResultServer) error // ReportPeerResult reports downloading result for the peer. ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error) // LeaveTask makes the peer leaving from task. LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error) // Checks if any peer has the given task. StatTask(context.Context, *StatTaskRequest) (*Task, error) // A peer announces that it has the announced task to other peers. AnnounceTask(context.Context, *AnnounceTaskRequest) (*emptypb.Empty, error) }
SchedulerServer is the server API for Scheduler service.
type Scheduler_ReportPieceResultClient ¶
type Scheduler_ReportPieceResultClient interface { Send(*PieceResult) error Recv() (*PeerPacket, error) grpc.ClientStream }
type Scheduler_ReportPieceResultServer ¶
type Scheduler_ReportPieceResultServer interface { Send(*PeerPacket) error Recv() (*PieceResult, error) grpc.ServerStream }
type SinglePiece ¶
type SinglePiece struct { // Destination peer id. DstPid string `protobuf:"bytes,1,opt,name=dst_pid,json=dstPid,proto3" json:"dst_pid,omitempty"` // Destination download address. DstAddr string `protobuf:"bytes,2,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"` // Piece info. PieceInfo *base.PieceInfo `protobuf:"bytes,3,opt,name=piece_info,json=pieceInfo,proto3" json:"piece_info,omitempty"` // contains filtered or unexported fields }
SinglePiece represents infomation of single piece.
func (*SinglePiece) Descriptor
deprecated
func (*SinglePiece) Descriptor() ([]byte, []int)
Deprecated: Use SinglePiece.ProtoReflect.Descriptor instead.
func (*SinglePiece) GetDstAddr ¶
func (x *SinglePiece) GetDstAddr() string
func (*SinglePiece) GetDstPid ¶
func (x *SinglePiece) GetDstPid() string
func (*SinglePiece) GetPieceInfo ¶
func (x *SinglePiece) GetPieceInfo() *base.PieceInfo
func (*SinglePiece) ProtoMessage ¶
func (*SinglePiece) ProtoMessage()
func (*SinglePiece) ProtoReflect ¶
func (x *SinglePiece) ProtoReflect() protoreflect.Message
func (*SinglePiece) Reset ¶
func (x *SinglePiece) Reset()
func (*SinglePiece) String ¶
func (x *SinglePiece) String() string
func (*SinglePiece) Validate ¶
func (m *SinglePiece) Validate() error
Validate checks the field values on SinglePiece with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SinglePieceValidationError ¶
type SinglePieceValidationError struct {
// contains filtered or unexported fields
}
SinglePieceValidationError is the validation error returned by SinglePiece.Validate if the designated constraints aren't met.
func (SinglePieceValidationError) Cause ¶
func (e SinglePieceValidationError) Cause() error
Cause function returns cause value.
func (SinglePieceValidationError) Error ¶
func (e SinglePieceValidationError) Error() string
Error satisfies the builtin error interface
func (SinglePieceValidationError) ErrorName ¶
func (e SinglePieceValidationError) ErrorName() string
ErrorName returns error name.
func (SinglePieceValidationError) Field ¶
func (e SinglePieceValidationError) Field() string
Field function returns field value.
func (SinglePieceValidationError) Key ¶
func (e SinglePieceValidationError) Key() bool
Key function returns key value.
func (SinglePieceValidationError) Reason ¶
func (e SinglePieceValidationError) Reason() string
Reason function returns reason value.
type StatTaskRequest ¶ added in v2.0.3
type StatTaskRequest struct { // Task id. TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // contains filtered or unexported fields }
StatTaskRequest represents request of StatTask.
func (*StatTaskRequest) Descriptor
deprecated
added in
v2.0.3
func (*StatTaskRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.
func (*StatTaskRequest) GetTaskId ¶ added in v2.0.3
func (x *StatTaskRequest) GetTaskId() string
func (*StatTaskRequest) ProtoMessage ¶ added in v2.0.3
func (*StatTaskRequest) ProtoMessage()
func (*StatTaskRequest) ProtoReflect ¶ added in v2.0.3
func (x *StatTaskRequest) ProtoReflect() protoreflect.Message
func (*StatTaskRequest) Reset ¶ added in v2.0.3
func (x *StatTaskRequest) Reset()
func (*StatTaskRequest) String ¶ added in v2.0.3
func (x *StatTaskRequest) String() string
func (*StatTaskRequest) Validate ¶ added in v2.0.3
func (m *StatTaskRequest) Validate() error
Validate checks the field values on StatTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type StatTaskRequestValidationError ¶ added in v2.0.3
type StatTaskRequestValidationError struct {
// contains filtered or unexported fields
}
StatTaskRequestValidationError is the validation error returned by StatTaskRequest.Validate if the designated constraints aren't met.
func (StatTaskRequestValidationError) Cause ¶ added in v2.0.3
func (e StatTaskRequestValidationError) Cause() error
Cause function returns cause value.
func (StatTaskRequestValidationError) Error ¶ added in v2.0.3
func (e StatTaskRequestValidationError) Error() string
Error satisfies the builtin error interface
func (StatTaskRequestValidationError) ErrorName ¶ added in v2.0.3
func (e StatTaskRequestValidationError) ErrorName() string
ErrorName returns error name.
func (StatTaskRequestValidationError) Field ¶ added in v2.0.3
func (e StatTaskRequestValidationError) Field() string
Field function returns field value.
func (StatTaskRequestValidationError) Key ¶ added in v2.0.3
func (e StatTaskRequestValidationError) Key() bool
Key function returns key value.
func (StatTaskRequestValidationError) Reason ¶ added in v2.0.3
func (e StatTaskRequestValidationError) Reason() string
Reason function returns reason value.
type Task ¶ added in v2.0.3
type Task struct { // Task id. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Task type. Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // Task content length. ContentLength int64 `protobuf:"varint,3,opt,name=content_length,json=contentLength,proto3" json:"content_length,omitempty"` // Task total piece count. TotalPieceCount int32 `protobuf:"varint,4,opt,name=total_piece_count,json=totalPieceCount,proto3" json:"total_piece_count,omitempty"` // Task state. State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` // Task peer count. PeerCount int32 `protobuf:"varint,6,opt,name=peer_count,json=peerCount,proto3" json:"peer_count,omitempty"` // Task contains available peer. HasAvailablePeer bool `protobuf:"varint,7,opt,name=hasAvailablePeer,proto3" json:"hasAvailablePeer,omitempty"` // contains filtered or unexported fields }
Task represents download task.
func (*Task) Descriptor
deprecated
added in
v2.0.3
func (*Task) GetContentLength ¶ added in v2.0.3
func (*Task) GetHasAvailablePeer ¶ added in v2.0.3
func (*Task) GetPeerCount ¶ added in v2.0.3
func (*Task) GetTotalPieceCount ¶ added in v2.0.3
func (*Task) ProtoMessage ¶ added in v2.0.3
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶ added in v2.0.3
func (x *Task) ProtoReflect() protoreflect.Message
type TaskValidationError ¶ added in v2.0.3
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 v2.0.3
func (e TaskValidationError) Cause() error
Cause function returns cause value.
func (TaskValidationError) Error ¶ added in v2.0.3
func (e TaskValidationError) Error() string
Error satisfies the builtin error interface
func (TaskValidationError) ErrorName ¶ added in v2.0.3
func (e TaskValidationError) ErrorName() string
ErrorName returns error name.
func (TaskValidationError) Field ¶ added in v2.0.3
func (e TaskValidationError) Field() string
Field function returns field value.
func (TaskValidationError) Key ¶ added in v2.0.3
func (e TaskValidationError) Key() bool
Key function returns key value.
func (TaskValidationError) Reason ¶ added in v2.0.3
func (e TaskValidationError) Reason() string
Reason function returns reason value.
type UnimplementedSchedulerServer ¶
type UnimplementedSchedulerServer struct { }
UnimplementedSchedulerServer can be embedded to have forward compatible implementations.
func (*UnimplementedSchedulerServer) AnnounceTask ¶ added in v2.0.3
func (*UnimplementedSchedulerServer) AnnounceTask(context.Context, *AnnounceTaskRequest) (*emptypb.Empty, error)
func (*UnimplementedSchedulerServer) LeaveTask ¶
func (*UnimplementedSchedulerServer) LeaveTask(context.Context, *PeerTarget) (*emptypb.Empty, error)
func (*UnimplementedSchedulerServer) RegisterPeerTask ¶
func (*UnimplementedSchedulerServer) RegisterPeerTask(context.Context, *PeerTaskRequest) (*RegisterResult, error)
func (*UnimplementedSchedulerServer) ReportPeerResult ¶
func (*UnimplementedSchedulerServer) ReportPeerResult(context.Context, *PeerResult) (*emptypb.Empty, error)
func (*UnimplementedSchedulerServer) ReportPieceResult ¶
func (*UnimplementedSchedulerServer) ReportPieceResult(Scheduler_ReportPieceResultServer) error
func (*UnimplementedSchedulerServer) StatTask ¶ added in v2.0.3
func (*UnimplementedSchedulerServer) StatTask(context.Context, *StatTaskRequest) (*Task, error)