Documentation ¶
Index ¶
- func GetRequestablePieces(input Input, f func(t *Torrent, p *Piece, pieceIndex int))
- func Run(input Input) map[PeerId]PeerNextRequestState
- type ChunkIndex
- type ChunkSpec
- type ChunksIter
- type ClientPieceOrder
- type Input
- type Peer
- type PeerId
- type PeerNextRequestState
- type Piece
- type Request
- type RequestIndex
- type Torrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRequestablePieces ¶ added in v1.32.0
Calls f with requestable pieces in order.
func Run ¶
func Run(input Input) map[PeerId]PeerNextRequestState
TODO: We could do metainfo requests here.
Types ¶
type ChunkIndex ¶ added in v1.32.0
type ChunkIndex = uint32
type ChunksIter ¶
type ChunksIter func(func(ChunkIndex))
type ClientPieceOrder ¶
type ClientPieceOrder struct{}
type Peer ¶
type Peer struct { HasPiece func(i pieceIndex) bool MaxRequests int HasExistingRequest func(r RequestIndex) bool Choking bool PieceAllowedFast func(pieceIndex) bool DownloadRate float64 Age time.Duration // This is passed back out at the end, so must support equality. Could be a type-param later. Id PeerId }
type PeerNextRequestState ¶
type RequestIndex ¶ added in v1.32.0
type RequestIndex = uint32
type Torrent ¶
type Torrent struct { Pieces []Piece Capacity storage.TorrentCapacity // Unclosed Peers. Not necessary for getting requestable piece ordering. Peers []Peer // Some value that's unique and stable between runs. Could even use the infohash? InfoHash metainfo.Hash ChunksPerPiece int MaxUnverifiedBytes int64 }
Click to show internal directories.
Click to hide internal directories.