announcer

package
v0.3.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHTAnnouncer

type DHTAnnouncer struct {
	// contains filtered or unexported fields
}

func NewDHTAnnouncer

func NewDHTAnnouncer() *DHTAnnouncer

func (*DHTAnnouncer) Close

func (a *DHTAnnouncer) Close()

func (*DHTAnnouncer) NeedMorePeers

func (a *DHTAnnouncer) NeedMorePeers(val bool)

func (*DHTAnnouncer) Run

func (a *DHTAnnouncer) Run(announceFunc func(), interval, minInterval time.Duration, l logger.Logger)

type PeriodicalAnnouncer

type PeriodicalAnnouncer struct {
	Tracker tracker.Tracker

	HasAnnounced bool
	// contains filtered or unexported fields
}

func NewPeriodicalAnnouncer

func NewPeriodicalAnnouncer(trk tracker.Tracker, numWant int, minInterval time.Duration, requests chan *Request, completedC chan struct{}, newPeers chan []*net.TCPAddr, l logger.Logger) *PeriodicalAnnouncer

func (*PeriodicalAnnouncer) Close

func (a *PeriodicalAnnouncer) Close()

func (*PeriodicalAnnouncer) NeedMorePeers

func (a *PeriodicalAnnouncer) NeedMorePeers(val bool)

func (*PeriodicalAnnouncer) Run

func (a *PeriodicalAnnouncer) Run()

func (*PeriodicalAnnouncer) Stats

func (a *PeriodicalAnnouncer) Stats() Stats

type Request

type Request struct {
	Response chan Response
	Cancel   chan struct{}
}

type Response

type Response struct {
	Torrent tracker.Torrent
}

type Stats

type Stats struct {
	Status   Status
	Error    error
	Seeders  int
	Leechers int
}

type Status

type Status int
const (
	NotContactedYet Status = iota
	Contacting
	Working
	NotWorking
)

type StopAnnouncer

type StopAnnouncer struct {
	// contains filtered or unexported fields
}

func NewStopAnnouncer

func NewStopAnnouncer(trackers []tracker.Tracker, tra tracker.Torrent, timeout time.Duration, resultC chan struct{}, l logger.Logger) *StopAnnouncer

func (*StopAnnouncer) Close

func (a *StopAnnouncer) Close()

func (*StopAnnouncer) Run

func (a *StopAnnouncer) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL