transmission

package
v0.0.0-...-24035bd Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Address for Json request
	Address  string
	Username string
	Password string
	// contains filtered or unexported fields
}

Client represents a Transmission client

func NewClient

func NewClient(addr, usr, pwd string) *Client

NewClient initialize a new Transmission client

func (*Client) Get

func (c *Client) Get(url string) (*http.Response, error)

Get function

func (*Client) Ping

func (c *Client) Ping() bool

Ping check the connection

func (*Client) SessionGet

func (c *Client) SessionGet() (*SessionGetResponse, error)

SessionGet method

func (*Client) TorrentAdd

func (c *Client) TorrentAdd(URL string, paused bool) (*TorrentAddResponse, error)

TorrentAdd method

func (*Client) TorrentRemove

func (c *Client) TorrentRemove(ids string, deleteLocalData bool) error

TorrentRemove method

type SessionGetResponse

type SessionGetResponse struct {
	// location of transmission's configuration directory
	ConfigDir string `json:"config-dir"`
	// default path to download torrents
	DownloadDir string `json:"download-dir"`
	//  max number of torrents to download at once (see download-queue-enabled)
	DownloadQueueSize int `json:"download-queue-size"`
	// if true, limit how many torrents can be downloaded at once
	DownloadQueueEnabled bool `json:"download-queue-enabled"`
	// true means allow dht in public torrents
	DhtEnabled bool `json:"dht-enabled"`
	// "required", "preferred", "tolerated"
	Encryption string
	// torrents we're seeding will be stopped if they're idle for this long
	IdleSeedingLimit int `json:"idle-seeding-limit"`
	// true if the seeding inactivity limit is honored by default
	IdleSeedingLimitEnabled bool `json:"idle-seeding-limit-enabled"`
	// path for incomplete torrents, when enabled
	InclompleteDir string `json:"incomplete-dir"`
	// true means keep torrents in incomplete-dir until done
	InclompleteDirEnabled bool `json:"incomplete-dir-enabled"`
	// the current RPC API version
	RPCVersion int `json:"rpc-version"`
	// the minimum RPC API version supported
	RPCVersionMinimum int `json:"rpc-version-minimum"`
	// long version string "$version ($revision)"
	Version string
}

SessionGetResponse represents the information returned by the SessionGet method.

type TorrentAddResponse

type TorrentAddResponse struct {
	TorrentAdded struct {
		ID         int    `json:"id"`
		HashString string `json:"hashString"`
		Name       string `json:"name"`
	} `json:"torrent-added"`
}

TorrentAddResponse represents the information returned by the TorrentAdd method.

Jump to

Keyboard shortcuts

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