Documentation
¶
Overview ¶
Package tracker provides support for announcing torrents to HTTP and UDP trackers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnnounceRequest ¶
type AnnounceResponse ¶
type CompactPeer ¶
func NewCompactPeer ¶
func NewCompactPeer(addr *net.TCPAddr) CompactPeer
func (CompactPeer) Addr ¶
func (p CompactPeer) Addr() *net.TCPAddr
func (CompactPeer) MarshalBinary ¶
func (p CompactPeer) MarshalBinary() ([]byte, error)
func (*CompactPeer) UnmarshalBinary ¶
func (p *CompactPeer) UnmarshalBinary(data []byte) error
type Event ¶
type Event int32
Tracker Announce Events. Numbers corresponds to constants in UDP tracker protocol.
type Tier ¶ added in v0.8.4
type Tier struct {
Trackers []Tracker
// contains filtered or unexported fields
}
func (*Tier) Announce ¶ added in v0.8.4
func (t *Tier) Announce(ctx context.Context, req AnnounceRequest) (*AnnounceResponse, error)
type Tracker ¶
type Tracker interface {
// Announce transfer to the tracker.
// Announce should be called periodically with the interval returned in AnnounceResponse.
// Announce should also be called on specific events.
Announce(ctx context.Context, req AnnounceRequest) (*AnnounceResponse, error)
// URL of the tracker.
URL() string
}
Click to show internal directories.
Click to hide internal directories.