Documentation
¶
Overview ¶
Package transmission implements the plugin.DownloadClient interface for the Transmission RPC API. Tested against Transmission 3.x and 4.x.
Index ¶
- type Client
- func (c *Client) Add(ctx context.Context, r plugin.Release) (string, error)
- func (c *Client) GetQueue(ctx context.Context) ([]plugin.QueueItem, error)
- func (c *Client) Name() string
- func (c *Client) Protocol() plugin.Protocol
- func (c *Client) Remove(ctx context.Context, clientItemID string, deleteFiles bool) error
- func (c *Client) SetSeedLimits(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error
- func (c *Client) Status(ctx context.Context, clientItemID string) (plugin.QueueItem, error)
- func (c *Client) Test(ctx context.Context) error
- type Config
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 NewWithHTTPClient ¶
NewWithHTTPClient creates a Client with a caller-supplied http.Client. Intended for unit tests that need to bypass the safe dialer.
func (*Client) Add ¶
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) Remove ¶
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".