Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerElectionAlgorithm ¶
var MostLeechedNonZeroSeeders PeerElectionAlgorithm = func(candidate1 Peers, candidate2 Peers) Peers {
if candidate1.seed == candidate2.seed {
return mostLeeched(candidate1, candidate2)
}
if candidate1.seed == 0 && candidate2.seed > 0 {
return candidate2
}
if candidate2.seed == 0 && candidate1.seed > 0 {
return candidate1
}
return mostLeeched(candidate1, candidate2)
}
MostLeechedNonZeroSeeders return the torrent with the most leechers. Peers with 0 seeders are not considered valid candidates
var MostSeededNonZeroLeechers PeerElectionAlgorithm = func(candidate1 Peers, candidate2 Peers) Peers {
if candidate1.leech == candidate2.leech {
return mostSeeded(candidate1, candidate2)
}
if candidate1.leech == 0 && candidate2.leech > 0 {
return candidate2
}
if candidate2.leech == 0 && candidate1.leech > 0 {
return candidate1
}
return mostSeeded(candidate1, candidate2)
}
MostSeededNonZeroLeechers return the torrent with the most seeders. Peers with 0 leechers are not considered valid candidates
type SharedTorrent ¶
type SharedTorrent interface { }
Click to show internal directories.
Click to hide internal directories.