Documentation
¶
Overview ¶
Package tracker implements the HTTP and UDP BitTorrent tracker protocols, as defined in BEP-3, BEP-7, BEP-23 and BEP-15.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotReady = errors.New("tracker not ready") ErrParse = errors.New("couldn't parse tracker reply") )
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP represents a tracker accessed over HTTP or HTTPS.
func (*HTTP) Announce ¶
func (tracker *HTTP) Announce(ctx context.Context, hash []byte, myid []byte, want int, size int64, port4, port6 int, proxy string, f func(netip.AddrPort) bool) error
Announce performs an HTTP announce over both IPv4 and IPv6 in parallel.
type Tracker ¶
type Tracker interface { // URL returns the tracker URL URL() string // GetState returns the tracker's state. If the state is Error, // then GetState also returns an error value. GetState() (State, error) // Announce performs parallel announces over both IPv4 and IPv6. Announce(ctx context.Context, hash []byte, myid []byte, want int, size int64, port4, port6 int, proxy string, f func(netip.AddrPort) bool) error }
Type Tracker represents a BitTorrent tracker.
type UDP ¶
type UDP struct {
// contains filtered or unexported fields
}
UDP represents a tracker using the protocol defined in BEP-15.
func (*UDP) Announce ¶
func (tracker *UDP) Announce(ctx context.Context, hash []byte, myid []byte, want int, size int64, port4, port6 int, proxy string, f func(netip.AddrPort) bool) error
Announce performs a UDP announce over IPv4 and Ipv6 in parallel.
type Unknown ¶
type Unknown struct {
// contains filtered or unexported fields
}
Unknown represents a tracker with an unknown scheme.
func (*Unknown) Announce ¶
func (tracker *Unknown) Announce(ctx context.Context, hash []byte, myid []byte, want int, size int64, port4, port6 int, proxy string, f func(netip.AddrPort) bool) error
Announce performs parallel announces over both IPv4 and IPv6.
Click to show internal directories.
Click to hide internal directories.