go-rtorrent: github.com/mrobinsn/go-rtorrent/rtorrent Index | Files

package rtorrent

import "github.com/mrobinsn/go-rtorrent/rtorrent"

Index

Package Files

rtorrent.go

type File Uses

type File struct {
    Path string
    Size int
}

File represents a file in rTorrent

func (*File) Pretty Uses

func (f *File) Pretty() string

Pretty returns a formatted string representing this File

type RTorrent Uses

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

RTorrent is used to communicate with a remote rTorrent instance

func New Uses

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 Uses

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

Add adds a new torrent by URL

func (*RTorrent) AddTorrent Uses

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

AddTorrent adds a new torrent by the torrent files data

func (*RTorrent) Delete Uses

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

Delete removes the torrent

func (*RTorrent) DownRate Uses

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

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

func (*RTorrent) DownTotal Uses

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

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

func (*RTorrent) GetFiles Uses

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

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

func (*RTorrent) GetStatus Uses

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

GetStatus returns the Status for a given Torrent

func (*RTorrent) GetTorrent Uses

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

GetTorrent returns the torrent identified by the given hash

func (*RTorrent) GetTorrents Uses

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

GetTorrents returns all of the torrents reported by this RTorrent instance

func (*RTorrent) IP Uses

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

IP returns the IP reported by this RTorrent instance

func (*RTorrent) Name Uses

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

Name returns the name reported by this RTorrent instance

func (*RTorrent) SetLabel Uses

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

SetLabel sets the label on the given Torrent

func (*RTorrent) UpRate Uses

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

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

func (*RTorrent) UpTotal Uses

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

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

func (*RTorrent) WithHTTPClient Uses

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

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

type Status Uses

type Status struct {
    Completed      bool
    CompletedBytes int
    DownRate       int
    UpRate         int
    Ratio          float64
    Size           int
}

Status represents the status of a torrent

type Torrent Uses

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 Uses

func (t *Torrent) Pretty() string

Pretty returns a formatted string representing this Torrent

type View Uses

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

Package rtorrent imports 4 packages (graph) and is imported by 2 packages. Updated 2019-08-24. Refresh now. Tools for package owners.