7 "github.com/anacrolix/torrent/tracker/udp"
10 // This is reserved for stuff like filtering by IP version, avoiding an announcer's IP or key,
11 // limiting return count, etc.
12 type GetPeersOpts struct{}
14 type InfoHash = [20]byte
16 type PeerInfo struct {
20 type AnnounceAddr = netip.AddrPort
22 type AnnounceTracker interface {
23 TrackAnnounce(ctx context.Context, req udp.AnnounceRequest, addr AnnounceAddr) error
24 Scrape(ctx context.Context, infoHashes []InfoHash) ([]udp.ScrapeInfohashResult, error)
25 GetPeers(ctx context.Context, infoHash InfoHash, opts GetPeersOpts) ([]PeerInfo, error)
29 //type Server struct {
30 // AnnounceTracker AnnounceTracker
33 //func (me Server) HandleAnnounce(req udp.AnnounceRequest, sourceAddr AnnounceAddr) error {