Documentation ¶
Index ¶
- Constants
- type BTServer
- func (bt *BTServer) AddTorrent(magnet metainfo.Magnet, onAdd func(*Torrent)) (*Torrent, error)
- func (bt *BTServer) BTState() *BTState
- func (bt *BTServer) CacheState(hash metainfo.Hash) *state.CacheState
- func (bt *BTServer) Connect() error
- func (bt *BTServer) Disconnect()
- func (bt *BTServer) GetTorrent(hash metainfo.Hash) *Torrent
- func (bt *BTServer) List() []*Torrent
- func (bt *BTServer) Play(torr *Torrent, file *torrent.File, preload int64, c echo.Context) error
- func (bt *BTServer) Reconnect() error
- func (bt *BTServer) RemoveTorrent(hash torrent.InfoHash)
- func (bt *BTServer) View(torr *Torrent, file *torrent.File, c echo.Context) error
- func (bt *BTServer) WriteState(w io.Writer)
- type BTState
- type Torrent
- func (t *Torrent) Close()
- func (t *Torrent) CloseReader(reader torrent.Reader)
- func (t *Torrent) Files() []*torrent.File
- func (t *Torrent) GotInfo() bool
- func (t *Torrent) Hash() metainfo.Hash
- func (t *Torrent) Length() int64
- func (t *Torrent) NewReader(file *torrent.File, readahead int64) torrent.Reader
- func (t *Torrent) Preload(file *torrent.File, size int64)
- func (t *Torrent) Stats() TorrentStats
- func (t *Torrent) Status() TorrentStatus
- func (t *Torrent) WaitInfo() bool
- type TorrentFileStat
- type TorrentStats
- type TorrentStatus
Constants ¶
View Source
const ( TorrentAdded = TorrentStatus(iota) TorrentGettingInfo TorrentPreload TorrentWorking TorrentClosed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTServer ¶
type BTServer struct {
// contains filtered or unexported fields
}
func (*BTServer) AddTorrent ¶
func (*BTServer) CacheState ¶
func (bt *BTServer) CacheState(hash metainfo.Hash) *state.CacheState
func (*BTServer) Disconnect ¶
func (bt *BTServer) Disconnect()
func (*BTServer) RemoveTorrent ¶
func (*BTServer) WriteState ¶
type Torrent ¶
type Torrent struct { *torrent.Torrent DownloadSpeed float64 UploadSpeed float64 BytesReadUsefulData int64 BytesWrittenData int64 PreloadSize int64 PreloadedBytes int64 // contains filtered or unexported fields }
func (*Torrent) CloseReader ¶
func (*Torrent) Stats ¶
func (t *Torrent) Stats() TorrentStats
func (*Torrent) Status ¶
func (t *Torrent) Status() TorrentStatus
type TorrentFileStat ¶
type TorrentStats ¶
type TorrentStats struct { Name string Hash string TorrentStatus TorrentStatus TorrentStatusString string LoadedSize int64 TorrentSize int64 PreloadedBytes int64 PreloadSize int64 DownloadSpeed float64 UploadSpeed float64 TotalPeers int PendingPeers int ActivePeers int ConnectedSeeders int HalfOpenPeers int BytesWritten int64 BytesWrittenData int64 BytesRead int64 BytesReadData int64 BytesReadUsefulData int64 ChunksWritten int64 ChunksRead int64 ChunksReadUseful int64 ChunksReadWasted int64 PiecesDirtiedGood int64 PiecesDirtiedBad int64 FileStats []TorrentFileStat }
type TorrentStatus ¶
type TorrentStatus int
func (TorrentStatus) String ¶
func (t TorrentStatus) String() string
Click to show internal directories.
Click to hide internal directories.