Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnounceHistory ¶
type AnnounceHistory struct {
// contains filtered or unexported fields
}
type AnnounceProps ¶
type AnnounceQueue ¶
type AnnounceQueue struct {
// contains filtered or unexported fields
}
func NewAnnounceQueue ¶
func NewAnnounceQueue() *AnnounceQueue
func (*AnnounceQueue) DiscardFutureEnqueueAndDestroy ¶
func (q *AnnounceQueue) DiscardFutureEnqueueAndDestroy()
func (*AnnounceQueue) Enqueue ¶
func (q *AnnounceQueue) Enqueue(req *announces.AnnounceRequest)
func (*AnnounceQueue) Request ¶
func (q *AnnounceQueue) Request() <-chan *announces.AnnounceRequest
type Peers ¶
type Peers interface { Seeders() int32 Leechers() int32 AddPeer(update SwarmUpdateRequest) Reset() }
type Stats ¶
type Stats interface { Uploaded() int64 Downloaded() int64 Left() int64 Corrupted() int64 AddUploaded(int64) AddDownloaded(int64) Reset() }
Stats stores the torrent current uploaded, downloaded, left and corrupted stats. Implementation MUST be thread-safe
type SwarmUpdateRequest ¶
type SwarmUpdateRequest struct {
// contains filtered or unexported fields
}
type Torrent ¶
type Torrent interface { Start(props AnnounceProps, announceQueue *AnnounceQueue, dispatcher bandwidth.SpeedDispatcher) Stop(ctx context.Context) InfoHash() torrent.InfoHash Path() string ChangePath(path string) MoveTo(directory string) error // AddDataFor add interval second worth of upload to Stats.Uploaded AddDataFor(interval time.Duration) }
Click to show internal directories.
Click to hide internal directories.