rtorrent

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2018 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

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

func (*RTorrent) Delete added in v0.6.0

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

Delete removes the torent

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