Documentation ¶
Index ¶
- type Manager
- func (dtm *Manager) Add(ctx context.Context, dfgetTask *types.DfGetTask) error
- func (dtm *Manager) Delete(ctx context.Context, clientID, taskID string) error
- func (dtm *Manager) Get(ctx context.Context, clientID, taskID string) (dfgetTask *types.DfGetTask, err error)
- func (dtm *Manager) GetCIDAndTaskIDsByPeerID(ctx context.Context, peerID string) (map[string]string, error)
- func (dtm *Manager) GetCIDByPeerIDAndTaskID(ctx context.Context, peerID, taskID string) (string, error)
- func (dtm *Manager) GetCIDsByTaskID(ctx context.Context, taskID string) ([]string, error)
- func (dtm *Manager) List(ctx context.Context, filter map[string]string) (dfgetTaskList []*types.DfGetTask, err error)
- func (dtm *Manager) UpdateStatus(ctx context.Context, clientID, taskID, status 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 DfgetTaskMgr.
func NewManager ¶
func NewManager(cfg *config.Config, register prometheus.Registerer) (*Manager, error)
NewManager returns a new Manager.
func (*Manager) Add ¶
Add a new dfgetTask, we use clientID and taskID to identify a dfgetTask uniquely. ClientID should be generated by dfget, supernode will use it directly. NOTE: We should create a new dfgetTask for each download process,
even if the downloads initiated by the same machine.
func (*Manager) Get ¶
func (dtm *Manager) Get(ctx context.Context, clientID, taskID string) (dfgetTask *types.DfGetTask, err error)
Get a dfgetTask info with specified clientID and taskID.
func (*Manager) GetCIDAndTaskIDsByPeerID ¶ added in v1.0.0
func (dtm *Manager) GetCIDAndTaskIDsByPeerID(ctx context.Context, peerID string) (map[string]string, error)
GetCIDAndTaskIDsByPeerID returns a cid<->taskID map by specified peerID.
func (*Manager) GetCIDByPeerIDAndTaskID ¶
func (dtm *Manager) GetCIDByPeerIDAndTaskID(ctx context.Context, peerID, taskID string) (string, error)
GetCIDByPeerIDAndTaskID returns cid with specified peerID and taskID.
func (*Manager) GetCIDsByTaskID ¶ added in v1.0.0
GetCIDsByTaskID returns cids as a string slice with specified taskID.
Click to show internal directories.
Click to hide internal directories.