Versions in this module Expand all Collapse all v1 v1.0.0 Feb 25, 2016 Changes in this version + var ErrBadRequest = ClientError("bad request") + var ErrClientUnapproved = ClientError("client is not approved") + var ErrMalformedRequest = ClientError("malformed request") + var ErrTorrentDNE = NotFoundError("torrent does not exist") + func AppendPeer(ipv4s, ipv6s *PeerList, ann *Announce, peer *Peer) int + func IsPublicError(err error) bool + type Announce struct + Compact bool + Config *config.Config + Downloaded uint64 + Event string + IPv4 Endpoint + IPv6 Endpoint + Infohash string + JWT string + Left uint64 + NumWant int + Peer *Peer + PeerID string + PeerV4 *Peer + PeerV6 *Peer + Torrent *Torrent + Uploaded uint64 + func (a *Announce) BuildPeer(t *Torrent) + func (a *Announce) ClientID() (clientID string) + func (a *Announce) HasIPv4() bool + func (a *Announce) HasIPv6() bool + type AnnounceResponse struct + Announce *Announce + Compact bool + Complete int + IPv4Peers PeerList + IPv6Peers PeerList + Incomplete int + Interval time.Duration + MinInterval time.Duration + type ClientError string + func (e ClientError) Error() string + type Endpoint struct + IP net.IP + Port uint16 + type NotFoundError ClientError + func (e NotFoundError) Error() string + type Peer struct + Downloaded uint64 + ID string + LastAnnounce int64 + Left uint64 + Uploaded uint64 + func (p *Peer) HasIPv4() bool + func (p *Peer) HasIPv6() bool + func (p *Peer) Key() PeerKey + type PeerKey string + func NewPeerKey(peerID string, ip net.IP) PeerKey + func (pk PeerKey) IP() net.IP + func (pk PeerKey) PeerID() string + type PeerList []Peer + type PeerMap struct + Config config.SubnetConfig + Peers map[string]map[PeerKey]Peer + Seeders bool + Size int32 + func NewPeerMap(seeders bool, cfg *config.Config) *PeerMap + func (pm *PeerMap) AppendPeers(ipv4s, ipv6s PeerList, ann *Announce, wanted int) (PeerList, PeerList) + func (pm *PeerMap) Contains(pk PeerKey) bool + func (pm *PeerMap) Delete(pk PeerKey) + func (pm *PeerMap) Len() int + func (pm *PeerMap) LookUp(pk PeerKey) (peer Peer, exists bool) + func (pm *PeerMap) Purge(unixtime int64) + func (pm *PeerMap) Put(p Peer) + type ProtocolError ClientError + func (e ProtocolError) Error() string + type Scrape struct + Config *config.Config + Infohashes []string + type ScrapeResponse struct + Files []*Torrent + type Torrent struct + Infohash string + LastAction int64 + Leechers *PeerMap + Seeders *PeerMap + Snatches uint64 + func (t *Torrent) PeerCount() int