announcer

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 14 Imported by: 0

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

type AnnounceError struct {
	Err     error
	Message string
	Unknown bool
}

func (*AnnounceError) ErrorWithType added in v0.10.0

func (e *AnnounceError) ErrorWithType() string

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, getTorrent func() tracker.Torrent, 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 Stats

type Stats struct {
	Status       Status
	Error        *AnnounceError
	Warning      string
	Seeders      int
	Leechers     int
	LastAnnounce time.Time
	NextAnnounce time.Time
}

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