Documentation ¶
Index ¶
- Constants
- type CDNClient
- type CDNManager
- func (cm *CDNManager) AddToCallback(peerTask *types.PeerTask)
- func (cm *CDNManager) OnNotify(c *manager.Scheduler)
- func (cm *CDNManager) TriggerTask(task *types.Task, callback func(peerTask *types.PeerTask, e *dferrors.DfError)) (err error)
- func (cm *CDNManager) Work(task *types.Task, stream *client.PieceSeedStream)
- type HostManager
- type Manager
- type PeerTask
- func (m *PeerTask) Add(pid string, task *types.Task, host *types.Host) *types.PeerTask
- func (m *PeerTask) AddFake(pid string, task *types.Task) *types.PeerTask
- func (m *PeerTask) AddTask(task *types.Task)
- func (m *PeerTask) CDNCallback(pt *types.PeerTask, err *dferrors.DfError)
- func (m *PeerTask) ClearPeerTask()
- func (m *PeerTask) Delete(pid string)
- func (m *PeerTask) DeleteTask(task *types.Task)
- func (m *PeerTask) Get(pid string) (h *types.PeerTask, ok bool)
- func (m *PeerTask) GetGCDelayTime() time.Duration
- func (m *PeerTask) RefreshDownloadMonitor(pt *types.PeerTask)
- func (m *PeerTask) SetDownloadingMonitorCallBack(callback func(*types.PeerTask))
- func (m *PeerTask) SetGCDelayTime(delay time.Duration)
- func (m *PeerTask) Update(pt *types.PeerTask)
- func (m *PeerTask) Walker(task *types.Task, limit int, walker func(pt *types.PeerTask) bool)
- func (m *PeerTask) WalkerReverse(task *types.Task, limit int, walker func(pt *types.PeerTask) bool)
- type TaskManager
Constants ¶
View Source
const ( HostLoadCDN = 10 HostLoadPeer = 4 )
View Source
const ( PeerGoneTimeout = int64(time.Second * 10) PeerForceGoneTimeout = int64(time.Minute * 2) )
View Source
const TinyFileSize = 128
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDNClient ¶
type CDNManager ¶
type CDNManager struct {
// contains filtered or unexported fields
}
func (*CDNManager) AddToCallback ¶
func (cm *CDNManager) AddToCallback(peerTask *types.PeerTask)
func (*CDNManager) OnNotify ¶
func (cm *CDNManager) OnNotify(c *manager.Scheduler)
func (*CDNManager) TriggerTask ¶
func (*CDNManager) Work ¶
func (cm *CDNManager) Work(task *types.Task, stream *client.PieceSeedStream)
type HostManager ¶
type HostManager struct {
// contains filtered or unexported fields
}
func (*HostManager) CalculateLoad ¶
func (m *HostManager) CalculateLoad(host *types.Host)
func (*HostManager) Delete ¶
func (m *HostManager) Delete(uuid string)
type Manager ¶
type Manager struct { CDNManager *CDNManager TaskManager *TaskManager HostManager *HostManager }
type PeerTask ¶
type PeerTask struct {
// contains filtered or unexported fields
}
func (*PeerTask) Add ¶
func (*PeerTask) CDNCallback ¶
func (*PeerTask) RefreshDownloadMonitor ¶
func (*PeerTask) SetDownloadingMonitorCallBack ¶
func (*PeerTask) Walker ¶
type TaskManager ¶
type TaskManager struct { PeerTask *PeerTask // contains filtered or unexported fields }
func (*TaskManager) Delete ¶
func (m *TaskManager) Delete(k string)
func (*TaskManager) Touch ¶
func (m *TaskManager) Touch(k string)
Click to show internal directories.
Click to hide internal directories.