tracker

package
v0.0.0-...-9619b5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL