Documentation ¶
Index ¶
- type File
- type RTorrent
- func (r *RTorrent) Add(url string) error
- func (r *RTorrent) AddStopped(url string) error
- func (r *RTorrent) AddTorrent(data []byte) error
- func (r *RTorrent) AddTorrentStopped(data []byte) error
- func (r *RTorrent) Delete(t Torrent) error
- func (r *RTorrent) DownRate() (int, error)
- func (r *RTorrent) DownTotal() (int, error)
- func (r *RTorrent) GetFiles(t Torrent) ([]File, error)
- func (r *RTorrent) GetStatus(t Torrent) (Status, error)
- func (r *RTorrent) GetTorrent(hash string) (Torrent, error)
- func (r *RTorrent) GetTorrents(view View) ([]Torrent, error)
- func (r *RTorrent) IP() (string, error)
- func (r *RTorrent) Name() (string, error)
- func (r *RTorrent) SetLabel(t Torrent, newLabel string) error
- func (r *RTorrent) UpRate() (int, error)
- func (r *RTorrent) UpTotal() (int, error)
- func (r *RTorrent) WithHTTPClient(client *http.Client) *RTorrent
- type Status
- type Torrent
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RTorrent ¶
type RTorrent struct {
// contains filtered or unexported fields
}
RTorrent is used to communicate with a remote rTorrent instance
func New ¶
New returns a new instance of `RTorrent` Pass in a true value for `insecure` to turn off certificate verification
func (*RTorrent) AddStopped ¶ added in v1.3.1
AddStopped adds a new torrent by URL in a stopped state
func (*RTorrent) AddTorrent ¶ added in v0.4.0
AddTorrent adds a new torrent by the torrent files data and starts the torrent
func (*RTorrent) AddTorrentStopped ¶ added in v1.3.1
AddTorrentStopped adds a new torrent by the torrent files data but does not start the torrent
func (*RTorrent) DownRate ¶ added in v1.3.1
DownRate returns the current download rate reported by this RTorrent instance (bytes/s)
func (*RTorrent) DownTotal ¶
DownTotal returns the total downloaded metric reported by this RTorrent instance (bytes)
func (*RTorrent) GetTorrent ¶ added in v1.3.1
GetTorrent returns the torrent identified by the given hash
func (*RTorrent) GetTorrents ¶
GetTorrents returns all of the torrents reported by this RTorrent instance
func (*RTorrent) UpRate ¶ added in v1.3.1
UpRate returns the current upload rate reported by this RTorrent instance (bytes/s)
type Status ¶ added in v1.3.1
type Status struct { Completed bool CompletedBytes int DownRate int UpRate int Ratio float64 Size int }
Status represents the status of a torrent
type Torrent ¶
type Torrent struct { Hash string Name string Path string Size int Label string Completed bool Ratio float64 }
Torrent represents a torrent in rTorrent
type View ¶
type View string
View represents a "view" within RTorrent
const ( // ViewMain represents the "main" view, containing all torrents ViewMain View = "main" // ViewStarted represents the "started" view, containing only torrents that have been started ViewStarted View = "started" // ViewStopped represents the "stopped" view, containing only torrents that have been stopped ViewStopped View = "stopped" // ViewHashing represents the "hashing" view, containing only torrents that are currently hashing ViewHashing View = "hashing" // ViewSeeding represents the "seeding" view, containing only torrents that are currently seeding ViewSeeding View = "seeding" )