Documentation ¶
Index ¶
- func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainfo.Hash, pieceIndex int))
- type ChunkIndex
- type ChunkSpec
- type ChunksIter
- type ChunksIterFunc
- type Input
- type PeerRequestState
- type Piece
- type PieceRequestOrder
- type PieceRequestOrderKey
- type PieceRequestOrderState
- type Request
- type RequestIndex
- type Torrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRequestablePieces ¶ added in v1.32.0
func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainfo.Hash, pieceIndex int))
Calls f with requestable pieces in order.
Types ¶
type ChunkIndex ¶ added in v1.32.0
type ChunkIndex = uint32
type ChunksIter ¶
type ChunksIter interface {
Iter(func(ci ChunkIndex))
}
type ChunksIterFunc ¶ added in v1.33.0
type ChunksIterFunc func(func(ChunkIndex))
type Input ¶
type Input interface { Torrent(metainfo.Hash) Torrent // Storage capacity, shared among all Torrents with the same storage.TorrentCapacity pointer in // their storage.Torrent references. Capacity() (cap int64, capped bool) // Across all the Torrents. This might be partitioned by storage capacity key now. MaxUnverifiedBytes() int64 }
type PeerRequestState ¶ added in v1.39.0
type PieceRequestOrder ¶ added in v1.39.0
type PieceRequestOrder struct {
// contains filtered or unexported fields
}
func NewPieceOrder ¶ added in v1.39.0
func NewPieceOrder() *PieceRequestOrder
func (*PieceRequestOrder) Add ¶ added in v1.39.0
func (me *PieceRequestOrder) Add(key PieceRequestOrderKey, state PieceRequestOrderState)
func (*PieceRequestOrder) Delete ¶ added in v1.39.0
func (me *PieceRequestOrder) Delete(key PieceRequestOrderKey)
func (*PieceRequestOrder) Len ¶ added in v1.39.0
func (me *PieceRequestOrder) Len() int
func (*PieceRequestOrder) Update ¶ added in v1.39.0
func (me *PieceRequestOrder) Update(key PieceRequestOrderKey, state PieceRequestOrderState)
type PieceRequestOrderKey ¶ added in v1.39.0
type PieceRequestOrderState ¶ added in v1.39.0
type RequestIndex ¶ added in v1.32.0
type RequestIndex = uint32
Click to show internal directories.
Click to hide internal directories.