Documentation ¶ Index ¶ Variables func AddPeerToRedis(infoHash string, peer *Peer) error func Init() type Peer func GetPeersFromRedis(infoHash string, numWant int) ([]*Peer, error) Constants ¶ This section is empty. Variables ¶ View Source var RDB *redis.Client Functions ¶ func AddPeerToRedis ¶ func AddPeerToRedis(infoHash string, peer *Peer) error func Init ¶ func Init() Types ¶ type Peer ¶ type Peer struct { PeerID string `bencode:"peer id"` // 对等节点的唯一标识符 IP string `bencode:"ip"` // 对等节点的 IP 地址 Port int `bencode:"port"` // 对等节点的端口号 LastSeen time.Time } func GetPeersFromRedis ¶ func GetPeersFromRedis(infoHash string, numWant int) ([]*Peer, error) Source Files ¶ View all Source files tracker.go Click to show internal directories. Click to hide internal directories.