Documentation ¶
Index ¶
- Constants
- Variables
- func NewSyncList() *syncList
- func SetLoggerFlag(flag int)
- type Config
- func (c *Config) DownloadLimiter() *rate.Limiter
- func (c *Config) GetCmdConfig() (string, []string, error)
- func (c *Config) NormlizeConfigDir() (bool, error)
- func (c *Config) SyncViper(nc Config)
- func (c *Config) UploadLimiter() *rate.Limiter
- func (c *Config) Validate(nc *Config) uint8
- func (c *Config) WriteDefault() error
- func (c *Config) WriteYaml(cf string) error
- type Engine
- func (e *Engine) Config() Config
- func (e *Engine) Configure(c *Config) error
- func (e *Engine) ConnStat() torrent.ConnStats
- func (e *Engine) DeleteTorrent(infohash string) error
- func (e *Engine) GetTorrents() *map[string]*Torrent
- func (e *Engine) IsConfigred() bool
- func (e *Engine) ManualStartTorrent(infohash string) error
- func (e *Engine) NewMagnet(magnetURI string) error
- func (e *Engine) NewTorrentByFilePath(path string) error
- func (e *Engine) NewTorrentByReader(r io.Reader) error
- func (e *Engine) NextWaitTask() error
- func (e *Engine) ParseTrackerList() error
- func (e *Engine) PushWaitTask(ih string) error
- func (e *Engine) RemoveCache(infohash string)
- func (e *Engine) RestoreCacheDir()
- func (e *Engine) RestoreTask(fn string) 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) StartTorrentWatcher() error
- func (e *Engine) StopFile(infohash, filepath string) error
- func (e *Engine) StopTorrent(infohash string) error
- func (e *Engine) TorrentCacheFileName(infohash string) string
- func (e *Engine) WriteStauts(_w io.Writer)
- type File
- type FileSizePair
- type Server
- type Torrent
Constants ¶
View Source
const ( ForbidRuntimeChange uint8 = 1 << iota NeedEngineReConfig NeedRestartWatch NeedUpdateTracker NeedLoadWaitList NeedUpdateRSS )
View Source
const ( CachedTorrentDir = ".cachedTorrents" TrashTorrentDir = ".trashTorrents" )
Variables ¶
Functions ¶
func NewSyncList ¶
func NewSyncList() *syncList
func SetLoggerFlag ¶
func SetLoggerFlag(flag int)
Types ¶
type Config ¶
type Config struct { AutoStart bool `yaml:"AutoStart"` EngineDebug bool `yaml:"EngineDebug"` MuteEngineLog bool `yaml:"MuteEngineLog"` ObfsPreferred bool `yaml:"ObfsPreferred"` ObfsRequirePreferred bool `yaml:"ObfsRequirePreferred"` DisableTrackers bool `yaml:"DisableTrackers"` DisableIPv6 bool `yaml:"DisableIPv6"` NoDefaultPortForwarding bool `yaml:"NoDefaultPortForwarding"` DisableUTP bool `yaml:"DisableUTP"` DownloadDirectory string `yaml:"DownloadDirectory"` WatchDirectory string `yaml:"WatchDirectory"` EnableUpload bool `yaml:"EnableUpload"` EnableSeeding bool `yaml:"EnableSeeding"` IncomingPort int `yaml:"IncomingPort"` DoneCmd string `yaml:"DoneCmd"` SeedRatio float32 `yaml:"SeedRatio"` SeedTime time.Duration `yaml:"SeedTime"` UploadRate string `yaml:"UploadRate"` DownloadRate string `yaml:"DownloadRate"` TrackerList string `yaml:"TrackerList"` AlwaysAddTrackers bool `yaml:"AlwaysAddTrackers"` ProxyURL string `yaml:"ProxyURL"` RssURL string `yaml:"RssURL"` ScraperURL string `yaml:"ScraperURL"` MaxConcurrentTask int `yaml:"MaxConcurrentTask"` AllowRuntimeConfigure bool `yaml:"AllowRuntimeConfigure"` }
func (*Config) DownloadLimiter ¶
func (*Config) NormlizeConfigDir ¶
func (*Config) UploadLimiter ¶
func (*Config) WriteDefault ¶
type Engine ¶
type Engine struct { sync.RWMutex // race condition on ts,client TsChanged chan struct{} Trackers []string // 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) ManualStartTorrent ¶
func (*Engine) NewTorrentByFilePath ¶
NewTorrentByFilePath -> newTorrentBySpec
func (*Engine) NewTorrentByReader ¶
NewTorrentByReader -> newTorrentBySpec
func (*Engine) NextWaitTask ¶
func (*Engine) ParseTrackerList ¶
func (*Engine) PushWaitTask ¶
func (*Engine) RemoveCache ¶
func (*Engine) RestoreCacheDir ¶
func (e *Engine) RestoreCacheDir()
func (*Engine) RestoreTask ¶
func (*Engine) StartTorrent ¶
func (*Engine) StartTorrentWatcher ¶
func (*Engine) StopTorrent ¶
func (*Engine) TorrentCacheFileName ¶
func (*Engine) WriteStauts ¶
type FileSizePair ¶
type FileSizePair struct {
// contains filtered or unexported fields
}
type Torrent ¶
type Torrent struct { sync.Mutex //anacrolix/torrent InfoHash string Name string Magnet string Loaded bool Downloaded int64 Uploaded int64 Size int64 Files []*File //cloud torrent Stats *torrent.TorrentStats Started bool Done bool DoneCmdCalled bool IsQueueing bool IsSeeding bool ManualStarted bool IsAllFilesDone bool Percent float32 DownloadRate float32 UploadRate float32 SeedRatio float32 AddedAt time.Time StartedAt time.Time FinishedAt time.Time StoppedAt time.Time // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.