transmission

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package transmission implements the plugin.DownloadClient interface for the Transmission RPC API. Tested against Transmission 3.x and 4.x.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements plugin.DownloadClient against the Transmission RPC API.

func New

func New(cfg Config) *Client

New creates a new Transmission client.

func NewWithHTTPClient

func NewWithHTTPClient(cfg Config, client *http.Client) *Client

NewWithHTTPClient creates a Client with a caller-supplied http.Client. Intended for unit tests that need to bypass the safe dialer.

func (*Client) Add

func (c *Client) Add(ctx context.Context, r plugin.Release) (string, error)

Add submits a torrent to Transmission. Magnet links and .torrent URLs are both supported. Returns the torrent's hashString as the client item ID.

func (*Client) GetQueue

func (c *Client) GetQueue(ctx context.Context) ([]plugin.QueueItem, error)

GetQueue returns all torrents currently tracked by Transmission.

func (*Client) Name

func (c *Client) Name() string

func (*Client) Protocol

func (c *Client) Protocol() plugin.Protocol

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, clientItemID string, deleteFiles bool) error

Remove deletes a torrent from Transmission. If deleteFiles is true the downloaded data is also removed from disk.

func (*Client) SetSeedLimits

func (c *Client) SetSeedLimits(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error

SetSeedLimits sets per-torrent seed ratio and idle time limits via the Transmission RPC. ratioLimit <= 0 means "follow global"; seedTimeSecs <= 0 means "follow global".

func (*Client) Status

func (c *Client) Status(ctx context.Context, clientItemID string) (plugin.QueueItem, error)

Status returns the current state of a single torrent by its hash string.

func (*Client) Test

func (c *Client) Test(ctx context.Context) error

Test verifies connectivity and authentication by fetching the session info.

type Config

type Config struct {
	URL      string `json:"url"` // e.g. "http://localhost:9091"
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

Config holds the connection settings for a Transmission instance.

Jump to

Keyboard shortcuts

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