Documentation
¶
Index ¶
Constants ¶
View Source
const ( // REQUEST type REQUEST = 0 // DATA type DATA = 1 // REJECT type REJECT = 2 )
Variables ¶
View Source
var ( // ErrCollectorClosed ... ErrCollectorClosed = errors.New("collector colsed") // ErrGetPiecesTimeout ... ErrGetPiecesTimeout = errors.New("get pieces timeout") // ErrRejectByPeer ... ErrRejectByPeer = errors.New("reject by peer") // ErrTooMuchPieces ... ErrTooMuchPieces = errors.New("too much peices") )
View Source
var ErrInvalidMetadata = errors.New("invalid metadata")
ErrInvalidMetadata ...
Functions ¶
func NewTorrentFromMetadata ¶
NewTorrentFrom ...
Types ¶
type Collector ¶
type Collector struct {
MaxPendingQueries int
// contains filtered or unexported fields
}
Collector collects metadata.
func NewCollector ¶
NewCollector creates and return a new metadata collector.
func (*Collector) Get ¶
Get adds a new query to the collector's queries queue. returns a error when queue is full.
func (*Collector) GetSync ¶
GetSync adds a new query to the collector's queries queue and wait until then query finished.
type Request ¶
Request is the metadata request.
func (*Request) RemoteAddr ¶
RemoteAddr returns net address of the querying peer.
type Torrent ¶
type Torrent struct {
Announce string
Info TorrentInfo
// contains filtered or unexported fields
}
Torrent ...
type TorrentInfo ¶
type TorrentInfo struct {
Files []TorrentSubFile
Length int64
Name string
PieceLength int64
Pieces string
}
TorrentInfo ...
Source Files
¶
Click to show internal directories.
Click to hide internal directories.