Documentation ¶
Index ¶
- type Manager
- func (tm *Manager) CheckTaskStatus(ctx context.Context, taskID string) (bool, error)
- func (tm *Manager) Delete(ctx context.Context, taskID string) error
- func (tm *Manager) Get(ctx context.Context, taskID string) (*types.TaskInfo, error)
- func (tm *Manager) GetPieces(ctx context.Context, taskID, clientID string, req *types.PiecePullRequest) (bool, interface{}, error)
- func (tm *Manager) List(ctx context.Context, filter map[string]string) ([]*types.TaskInfo, error)
- func (tm *Manager) Register(ctx context.Context, req *types.TaskCreateRequest) (taskCreateResponse *types.TaskCreateResponse, err error)
- func (tm *Manager) Update(ctx context.Context, taskID string, taskInfo *types.TaskInfo) error
- func (tm *Manager) UpdatePieceStatus(ctx context.Context, taskID, pieceRange string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an implementation of the interface of TaskMgr.
func NewManager ¶
func NewManager(cfg *config.Config, peerMgr mgr.PeerMgr, dfgetTaskMgr mgr.DfgetTaskMgr, progressMgr mgr.ProgressMgr, cdnMgr mgr.CDNMgr, schedulerMgr mgr.SchedulerMgr) (*Manager, error)
NewManager returns a new Manager Object.
func (*Manager) CheckTaskStatus ¶
CheckTaskStatus check the task status.
func (*Manager) GetPieces ¶
func (tm *Manager) GetPieces(ctx context.Context, taskID, clientID string, req *types.PiecePullRequest) (bool, interface{}, error)
GetPieces get the pieces to be downloaded based on the scheduling result.
func (*Manager) Register ¶
func (tm *Manager) Register(ctx context.Context, req *types.TaskCreateRequest) (taskCreateResponse *types.TaskCreateResponse, err error)
Register will not only register a task.
func (*Manager) UpdatePieceStatus ¶
func (tm *Manager) UpdatePieceStatus(ctx context.Context, taskID, pieceRange string, pieceUpdateRequest *types.PieceUpdateRequest) error
UpdatePieceStatus update the piece status with specified parameters.
Click to show internal directories.
Click to hide internal directories.