Documentation ¶
Index ¶
- Constants
- Variables
- type DownloadStatus
- type HTTPTracker
- type Manager
- func (m *Manager) Announce(hash meta.Hash, status *DownloadStatus) ([]string, error)
- func (m *Manager) Finish(hash meta.Hash, status *DownloadStatus) ([]string, error)
- func (m *Manager) GetWaitTime() time.Time
- func (m *Manager) Start(hash meta.Hash, status *DownloadStatus) ([]string, error)
- func (m *Manager) Stop(hash meta.Hash, status *DownloadStatus) ([]string, error)
- type Tracker
- type UDPTracker
Constants ¶
View Source
const ( EventNone = 0 EventComplete = 1 EventStart = 2 EventStop = 3 )
announce event
Variables ¶
View Source
var (
ErrNoVaildTracker = errors.New("no vaild tracker")
)
Tracker error
Functions ¶
This section is empty.
Types ¶
type DownloadStatus ¶
DownloadStatus is the download status to announce tracker
type HTTPTracker ¶
type HTTPTracker struct {
// contains filtered or unexported fields
}
HTTPTracker is a tracker use HTTP
func NewHTTPTracker ¶
func NewHTTPTracker(url string) *HTTPTracker
NewHTTPTracker create a http tracker by url
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager mange trackers of a task
func NewManager ¶
NewManager return a Manager instance
func (*Manager) GetWaitTime ¶
GetWaitTime return the time will wait for next announce
type Tracker ¶
type Tracker interface { Announce(hash meta.Hash, id []byte, ip net.IP, port int, event int, status *DownloadStatus) ([]string, error) // contains filtered or unexported methods }
Tracker is a tracker interface
type UDPTracker ¶
type UDPTracker struct { url.URL RecvStatus chan DownloadStatus // contains filtered or unexported fields }
UDPTracker is a tracker use UDP
func NewUDPTracker ¶
func NewUDPTracker(rawurl string) *UDPTracker
NewUDPTracker is used for create a udp tracker
Click to show internal directories.
Click to hide internal directories.