rtorrent

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path string
	Size int
}

File represents a file in rTorrent

func (*File) Pretty

func (f *File) Pretty() string

Pretty returns a formatted string representing this File

type RTorrent

type RTorrent struct {
	// contains filtered or unexported fields
}

RTorrent is used to communicate with a remote rTorrent instance

func New

func New(addr string, insecure bool) *RTorrent

New returns a new instance of `RTorrent` Pass in a true value for `insecure` to turn off certificate verification

func (*RTorrent) Add added in v0.4.0

func (r *RTorrent) Add(url string) error

Add adds a new torrent by URL and starts the torrent

func (*RTorrent) AddStopped added in v1.3.1

func (r *RTorrent) AddStopped(url string) error

AddStopped adds a new torrent by URL in a stopped state

func (*RTorrent) AddTorrent added in v0.4.0

func (r *RTorrent) AddTorrent(data []byte) error

AddTorrent adds a new torrent by the torrent files data and starts the torrent

func (*RTorrent) AddTorrentStopped added in v1.3.1

func (r *RTorrent) AddTorrentStopped(data []byte) error

AddTorrentStopped adds a new torrent by the torrent files data but does not start the torrent

func (*RTorrent) Delete added in v0.6.0

func (r *RTorrent) Delete(t Torrent) error

Delete removes the torrent

func (*RTorrent) DownRate added in v1.3.1

func (r *RTorrent) DownRate() (int, error)

DownRate returns the current download rate reported by this RTorrent instance (bytes/s)

func (*RTorrent) DownTotal

func (r *RTorrent) DownTotal() (int, error)

DownTotal returns the total downloaded metric reported by this RTorrent instance (bytes)

func (*RTorrent) GetFiles

func (r *RTorrent) GetFiles(t Torrent) ([]File, error)

GetFiles returns all of the files for a given `Torrent`

func (*RTorrent) GetStatus added in v1.3.1

func (r *RTorrent) GetStatus(t Torrent) (Status, error)

GetStatus returns the Status for a given Torrent

func (*RTorrent) GetTorrent added in v1.3.1

func (r *RTorrent) GetTorrent(hash string) (Torrent, error)

GetTorrent returns the torrent identified by the given hash

func (*RTorrent) GetTorrents

func (r *RTorrent) GetTorrents(view View) ([]Torrent, error)

GetTorrents returns all of the torrents reported by this RTorrent instance

func (*RTorrent) IP

func (r *RTorrent) IP() (string, error)

IP returns the IP reported by this RTorrent instance

func (*RTorrent) Name

func (r *RTorrent) Name() (string, error)

Name returns the name reported by this RTorrent instance

func (*RTorrent) SetLabel

func (r *RTorrent) SetLabel(t Torrent, newLabel string) error

SetLabel sets the label on the given Torrent

func (*RTorrent) UpRate added in v1.3.1

func (r *RTorrent) UpRate() (int, error)

UpRate returns the current upload rate reported by this RTorrent instance (bytes/s)

func (*RTorrent) UpTotal

func (r *RTorrent) UpTotal() (int, error)

UpTotal returns the total uploaded metric reported by this RTorrent instance (bytes)

func (*RTorrent) WithHTTPClient added in v0.5.0

func (r *RTorrent) WithHTTPClient(client *http.Client) *RTorrent

WithHTTPClient allows you to a provide a custom http.Client.

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

func (*Torrent) Pretty

func (t *Torrent) Pretty() string

Pretty returns a formatted string representing this Torrent

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL