Documentation ¶
Index ¶
- Constants
- Variables
- type DotTorrentWithOptions
- type Rtorrent
- func (r *Rtorrent) Check(ts ...*Torrent) error
- func (r *Rtorrent) Delete(withData bool, ts ...*Torrent) error
- func (r *Rtorrent) Download(url string) error
- func (r *Rtorrent) DownloadWithOptions(tFile *DotTorrentWithOptions) error
- func (r *Rtorrent) GetTorrent(hash string) (*Torrent, error)
- func (r *Rtorrent) Speeds() (down, up uint64)
- func (r *Rtorrent) Start(ts ...*Torrent) error
- func (r *Rtorrent) Stats() (*stats, error)
- func (r *Rtorrent) Stop(ts ...*Torrent) error
- func (r *Rtorrent) Torrents() (Torrents, error)
- type Torrent
- type Torrents
Constants ¶
const ( Leeching = "Leeching" Seeding = "Seeding" Complete = "Complete" Stopped = "Stopped" Hashing = "Hashing" Error = "Error" )
const ( DefaultSorting sorting = iota ByName ByNameRev ByDownRate ByDownRateRev ByUpRate ByUpRateRev BySize BySizeRev ByRatio ByRatioRev ByAge ByAgeRev ByUpTotal ByUpTotalRev )
Variables ¶
var CurrentSorting = DefaultSorting
CurrentSorting holds the sorting in use.
Functions ¶
This section is empty.
Types ¶
type DotTorrentWithOptions ¶
DotTorrentWithOptions is used when adding .torrent file with options. ; the options get passed via the "Caption" when sending a file via telegram ; telegram, e.g d=/dir/to/downloads l=Software, will save the added torrent ; torrent to the specified direcotry, and will assigne the label "Software" ; to it, labels are saved to "d.custom1", which is used by ruTorrent. ;
type Rtorrent ¶
type Rtorrent struct { Version string // contains filtered or unexported fields }
Rtorrent holds the network and address e.g.'tcp|localhost:5000' or 'unix|path/to/socket'.
func NewRtorrent ¶
NewRtorrent takes the address, defined in .rtorrent.rc
func (*Rtorrent) Delete ¶
Delete takes *Torrent or more to 'd.erase' it/them, if withData is true, local data will get deleted too.
func (*Rtorrent) DownloadWithOptions ¶
func (r *Rtorrent) DownloadWithOptions(tFile *DotTorrentWithOptions) error
DownloadWithOptions takes *DotTorrentWithOptions downloading it.
func (*Rtorrent) GetTorrent ¶
GetTorrent takes a hash and returns *Torrent
type Torrent ¶
type Torrent struct { Name string Hash string DownRate uint64 UpRate uint64 Size uint64 Completed uint64 Percent string ETA uint64 Ratio float64 Age uint64 UpTotal uint64 State string Message string Tracker *url.URL Path string Label string // ruTorrent lables }
Torrent represents a single torrent.