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 Error ¶
type Error string
Error is the string that is sent by the tracker from announce or scrape.
type Event ¶
type Event int32
Tracker Announce Events. Numbers corresponds to constants in UDP tracker protocol.
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.