Skip to content

Latest commit

 

History

105 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-transmission

GoDev Test Status

go-transmission is a Go client library for talking to Transmission torrent client via JSON RPC.

The library is written for RPC version 15 (Transmission >= 2.80), but should work with future Transmission versions without problems.

The API is not yet considered stable and might break without prior notice.

Usage

import "github.com/pborzenkov/go-transmission/transmission"

Construct a new Transmission client and use it to access Transmission functions. For example:

client, err := transmission.New("http://localhost:9091")

// Add new torrent from local file contents
file, err := os.Open("/local/file.torrent")
torrent, err := client.AddTorrent(context.Background(), &transmission.AddTorrentReq{
    Meta: file,
})

// Add new torrent using magnet link
torrent, err := client.AddTorrent(context.Background(), &transmission.AddTorrentReq{
    URL: <magnet link>,
})

// Get IDs and names of recently active torrents
torrents, err := client.GetTorrents(context.Background(), transmission.RecentlyActive(),
        transmission.TorrentFieldID, transmission.TorrentFieldName)

License

MIT - See LICENSE file

About

Transmission RPC bindings for Go

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages