Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnounceError ¶ added in v0.9.0
AnnounceError the error that comes from the Tracker itself.
func (*AnnounceError) ErrorWithType ¶ added in v0.10.0
func (e *AnnounceError) ErrorWithType() string
ErrorWithType returns the error string that is prefixed with type name.
type DHTAnnouncer ¶
type DHTAnnouncer struct {
// contains filtered or unexported fields
}
DHTAnnouncer runs a function periodically to announce the Torrent to DHT network.
func NewDHTAnnouncer ¶
func NewDHTAnnouncer() *DHTAnnouncer
NewDHTAnnouncer returns a new DHTAnnouncer.
func (*DHTAnnouncer) NeedMorePeers ¶
func (a *DHTAnnouncer) NeedMorePeers(val bool)
NeedMorePeers signals the announcer goroutine to fetch more peers from DHT.
type PeriodicalAnnouncer ¶
type PeriodicalAnnouncer struct { Tracker tracker.Tracker HasAnnounced bool // contains filtered or unexported fields }
PeriodicalAnnouncer announces the Torrent to the Tracker periodically.
func NewPeriodicalAnnouncer ¶
func NewPeriodicalAnnouncer(trk tracker.Tracker, numWant int, minInterval time.Duration, getTorrent func() tracker.Torrent, completedC chan struct{}, newPeers chan []*net.TCPAddr, l logger.Logger) *PeriodicalAnnouncer
NewPeriodicalAnnouncer returns a new PeriodicalAnnouncer.
func (*PeriodicalAnnouncer) NeedMorePeers ¶
func (a *PeriodicalAnnouncer) NeedMorePeers(val bool)
NeedMorePeers signals the announcer goroutine about the need of more peers.
func (*PeriodicalAnnouncer) Run ¶
func (a *PeriodicalAnnouncer) Run()
Run the announcer goroutine. Invoke with go statement.
func (*PeriodicalAnnouncer) Stats ¶
func (a *PeriodicalAnnouncer) Stats() Stats
Stats about the tracker and the announce operation.
type Stats ¶
type Stats struct { Status Status Error *AnnounceError Warning string Seeders int Leechers int LastAnnounce time.Time NextAnnounce time.Time }
Stats about the announcer.
type StopAnnouncer ¶
type StopAnnouncer struct {
// contains filtered or unexported fields
}
StopAnnouncer is used to send a stop event to the Tracker.