Documentation
¶
Index ¶
- Constants
- type Config
- type Engine
- func (e *Engine) Config() Config
- func (e *Engine) Configure(c Config) error
- func (e *Engine) DeleteTorrent(infohash string) error
- func (e *Engine) GetTorrents() map[string]*Torrent
- func (e *Engine) IsConfigred() bool
- func (e *Engine) NewMagnet(magnetURI string) error
- func (e *Engine) NewTorrentByFilePath(path string) error
- func (e *Engine) NewTorrentBySpec(spec *torrent.TorrentSpec) error
- func (e *Engine) SetConfig(c Config)
- func (e *Engine) StartFile(infohash, filepath string) error
- func (e *Engine) StartTorrent(infohash string) error
- func (e *Engine) StopFile(infohash, filepath string) error
- func (e *Engine) StopTorrent(infohash string) error
- func (e *Engine) TaskRoutine()
- func (e *Engine) UpdateTrackers() error
- func (e *Engine) WriteStauts(_w io.Writer)
- type File
- type Server
- type Torrent
Constants ¶
View Source
const ( ForbidRuntimeChange uint8 = 1 << iota NeedEngineReConfig NeedRestartWatch NeedUpdateTracker )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { AutoStart bool EngineDebug bool MuteEngineLog bool ObfsPreferred bool ObfsRequirePreferred bool DisableTrackers bool DisableIPv6 bool DownloadDirectory string WatchDirectory string EnableUpload bool EnableSeeding bool IncomingPort int DoneCmd string SeedRatio float32 UploadRate string DownloadRate string TrackerListURL string AlwaysAddTrackers bool ProxyURL string RssURL string ScraperURL string }
func (*Config) DownloadLimiter ¶
func (*Config) NormlizeConfigDir ¶
func (*Config) UploadLimiter ¶
type Engine ¶
type Engine struct { sync.RWMutex // race condition on ts,client // contains filtered or unexported fields }
the Engine Cloud Torrent engine, backed by anacrolix/torrent
func (*Engine) DeleteTorrent ¶
func (*Engine) GetTorrents ¶
GetTorrents just get the local infohash->Torrent map
func (*Engine) IsConfigred ¶
func (*Engine) NewTorrentByFilePath ¶
NewTorrentByFilePath -> NewTorrentBySpec
func (*Engine) NewTorrentBySpec ¶
func (e *Engine) NewTorrentBySpec(spec *torrent.TorrentSpec) error
NewTorrentBySpec -> *Torrent -> addTorrentTask
func (*Engine) StartTorrent ¶
func (*Engine) StopTorrent ¶
func (*Engine) TaskRoutine ¶
func (e *Engine) TaskRoutine()
TaskRoutine called by intevaled background goroutine moves torrents out of the anacrolix/torrent and into the local cache and do condition check and actions on them
func (*Engine) UpdateTrackers ¶
func (*Engine) WriteStauts ¶
type Torrent ¶
type Torrent struct { //anacrolix/torrent InfoHash string Name string Magnet string Loaded bool Downloaded int64 Uploaded int64 Size int64 Files []*File //cloud torrent Started bool Done bool DoneCmdCalled bool Percent float32 DownloadRate float32 UploadRate float32 SeedRatio float32 AddedAt time.Time StartedAt time.Time Stats torrent.TorrentStats // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.