Skip to content

About

rTorrent XMLRPC Bindings for Go

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

go-rtorrent

GoDoc Coverage Status MIT license

rTorrent XMLRPC Bindings for Go (golang)

Fork of github.com/mrobinsn/go-rtorrent.

Documentation

GoDoc

Features

  • Get IP, Name, Up/Down totals
  • Get torrents within a view
  • Get torrent by hash
  • Get files for torrents
  • Set the label on a torrent
  • Add a torrent by URL or by metadata
  • Delete a torrent (including files)

Installation

To install the package, run go get github.com/autobrr/go-rtorrent

To use it in application, import "github.com/autobrr/go-rtorrent"

Library Usage

client := rtorrent.NewClient(rtorrent.Config{Addr: "http://my-rtorrent.com/RPC2"})
name, _ := client.Name(context.Background())
fmt.Printf("My rTorrent's name: %v", name)

You can connect to a server using Basic Authentication by adding User and Pass to the config:

client := rtorrent.NewClient(rtorrent.Config{Addr: "http://my-rtorrent.com/RPC2", BasicUser: "user", BasicPass: "pass"})

Contributing

Pull requests are welcome, please ensure you add relevant tests for any new/changed functionality.

Testing

Unit tests need nothing but Go:

go test ./...

Integration tests need Docker. They start two rTorrent containers with Testcontainers, one under test and one as its peer, and transfer generated torrents between them, so they don't need internet access:

go test -tags integration ./...

They default to crazymax/rtorrent-rutorrent:latest. Set RTORRENT_TEST_IMAGE to test another image.

About

rTorrent XMLRPC Bindings for Go

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages