Documentation ¶
Index ¶
- func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainfo.Hash, pieceIndex int))
- func NewAjwernerBtree() *ajwernerBtree
- func NewTidwallBtree() *tidwallBtree
- type Btree
- type ChunkIndex
- type ChunkSpec
- type ChunksIter
- type ChunksIterFunc
- type Input
- type PeerRequestState
- type Piece
- type PieceRequestOrder
- type PieceRequestOrderKey
- type PieceRequestOrderPathHint
- type PieceRequestOrderState
- type Request
- type RequestIndex
- type Torrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRequestablePieces ¶
func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainfo.Hash, pieceIndex int))
Calls f with requestable pieces in order.
func NewAjwernerBtree ¶
func NewAjwernerBtree() *ajwernerBtree
func NewTidwallBtree ¶
func NewTidwallBtree() *tidwallBtree
Types ¶
type Btree ¶
type Btree interface { Delete(pieceRequestOrderItem) Add(pieceRequestOrderItem) Scan(func(pieceRequestOrderItem) bool) }
type ChunkIndex ¶
type ChunkIndex = uint32
type ChunksIter ¶
type ChunksIter interface {
Iter(func(ci ChunkIndex))
}
type ChunksIterFunc ¶
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 ¶
type PieceRequestOrder ¶
type PieceRequestOrder struct {
// contains filtered or unexported fields
}
func NewPieceOrder ¶
func NewPieceOrder(btree Btree, cap int) *PieceRequestOrder
func (*PieceRequestOrder) Add ¶
func (me *PieceRequestOrder) Add(key PieceRequestOrderKey, state PieceRequestOrderState)
func (*PieceRequestOrder) Delete ¶
func (me *PieceRequestOrder) Delete(key PieceRequestOrderKey)
func (*PieceRequestOrder) Len ¶
func (me *PieceRequestOrder) Len() int
func (*PieceRequestOrder) Update ¶
func (me *PieceRequestOrder) Update( key PieceRequestOrderKey, state PieceRequestOrderState, )
type PieceRequestOrderKey ¶
type PieceRequestOrderState ¶
type RequestIndex ¶
type RequestIndex = uint32
Click to show internal directories.
Click to hide internal directories.