Documentation ¶
Index ¶
- type Config
- type Engine
- func (e *Engine) Configure(c *Config) error
- func (e *Engine) Get(hex string) (*Torrent, bool)
- func (e *Engine) NewByFile(body io.Reader) error
- func (e *Engine) NewByMagnet(magnetURI string) error
- func (e *Engine) OpenTorrent(info *metainfo.Info) torrent.Data
- func (e *Engine) Remove(rmt *Torrent) error
- func (e *Engine) Update()
- type File
- type IHash
- type MediaSortConfig
- type StorageInfo
- type Stream
- type Torrent
- func (torrent *Torrent) Close()
- func (torrent *Torrent) File(off int64) (*File, int64)
- func (torrent *Torrent) Get(path string) (*File, bool)
- func (torrent *Torrent) PieceComplete(index int) bool
- func (torrent *Torrent) PieceCompleted(index int) error
- func (torrent *Torrent) ReadAt(p []byte, off int64) (n int, err error)
- func (torrent *Torrent) Start() error
- func (torrent *Torrent) Stop() error
- func (torrent *Torrent) Update(tt torrent.Torrent)
- func (torrent *Torrent) WriteAt(p []byte, off int64) (n int, err error)
- func (torrent *Torrent) WriteSectionTo(w io.Writer, off, n int64) (written int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { //public torrents Torrents map[string]*Torrent // contains filtered or unexported fields }
the Engine Cloud Torrent engine, backed by anacrolix/torrent
func (*Engine) NewByMagnet ¶
func (*Engine) OpenTorrent ¶
OpenTorrent implements the torrent.Openner interface and Torrent implements the torrent.Data interface
type File ¶
type MediaSortConfig ¶
type StorageInfo ¶
type Torrent ¶
type Torrent struct { //cloud torrent Started bool Dropped bool Percent float32 DownloadRate float32 //anacrolix/torrent InfoHash string Name string Loaded bool Downloaded int64 Size int64 Files []*File // contains filtered or unexported fields }
Torrent is converted to JSON and sent to the frontend
func NewTorrent ¶
func NewTorrent(ih string, storage *storage.Storage, sortConfig *MediaSortConfig) *Torrent
func (*Torrent) PieceComplete ¶
Returns true if the piece is complete.
func (*Torrent) PieceCompleted ¶
We believe the piece data will pass a hash check.
Click to show internal directories.
Click to hide internal directories.