Documentation
¶
Index ¶
- Variables
- type ArrayResponse
- type BoolResponse
- type Client
- func (c *Client) AddTorrent(url string) error
- func (c *Client) AddTorrentFile(torrentpath string) error
- func (c *Client) GetTorrent(hash string) (Torrent, error)
- func (c *Client) GetTorrents() ([]Torrent, error)
- func (c *Client) PauseTorrent(hash string) error
- func (c *Client) QueueBottom(hash string) error
- func (c *Client) QueueDown(hash string) error
- func (c *Client) QueueTop(hash string) error
- func (c *Client) QueueUp(hash string) error
- func (c *Client) RecheckTorrent(hash string) error
- func (c *Client) RemoveTorrent(hash string) error
- func (c *Client) RemoveTorrentAndData(hash string) error
- func (c *Client) SetTorrentLabel(hash string, label string) error
- func (c *Client) SetTorrentSeedRatio(hash string, ratio float64) error
- func (c *Client) SetTorrentSeedTime(hash string, time int) error
- func (c *Client) StartTorrent(hash string) error
- func (c *Client) StopTorrent(hash string) error
- func (c *Client) UnPauseTorrent(hash string) error
- type RpcError
- type StringResponse
- type Torrent
- type TorrentResponse
- type TorrentsResponse
Constants ¶
This section is empty.
Variables ¶
var TorrentProperties string = "" /* 327-byte string literal not displayed */
TorrentProperties is a string containing the json keys to grab via JSONRPC it vastly speeds up the call due to only grabbing the required values
Functions ¶
This section is empty.
Types ¶
type ArrayResponse ¶
type BoolResponse ¶
type Client ¶
type Client struct {
API string
Username string
Password string
// contains filtered or unexported fields
}
func (*Client) AddTorrent ¶
AddTorrent adds the torrent specified by url or magnet link
func (*Client) AddTorrentFile ¶
AddTorrentFile adds the torrent specified by a file on disk
func (*Client) GetTorrent ¶
GetTorrent gets a specific torrent by info hash
func (*Client) GetTorrents ¶
GetTorrents returns a list of Torrent structs containing all of the torrents added to the deluge/Bittorrent server
func (*Client) PauseTorrent ¶
PauseTorrent pauses the torrent specified by info hash
func (*Client) QueueBottom ¶
QueueTop sends the torrent to the bottom of the download queue
func (*Client) RecheckTorrent ¶
RecheckTorrent rechecks the torrent specified by info hash
func (*Client) RemoveTorrent ¶
RemoveTorrent removes the torrent specified by info hash
func (*Client) RemoveTorrentAndData ¶
RemoveTorrentAndData removes the torrent and associated data specified by info hash
func (*Client) SetTorrentLabel ¶
SetTorrentLabel sets the label for the given torrent
func (*Client) SetTorrentSeedRatio ¶
SetTorrentSeedRatio sets the seed ratio for the given torrent
func (*Client) SetTorrentSeedTime ¶
SetTorrentSeedTime sets the seed time for the given torrent
func (*Client) StartTorrent ¶
StartTorrent starts the torrent specified by info hash
func (*Client) StopTorrent ¶
StopTorrent stops the torrent specified by info hash
func (*Client) UnPauseTorrent ¶
UnPauseTorrent unpauses the torrent specified by info hash
type StringResponse ¶
type Torrent ¶
type Torrent struct {
Hash string `json:"hash"`
StatusCode int `json:"status_code"`
Name string `json:"name"`
Size int `json:"total_size"`
PercentProgress float64 `json:"progress"`
Downloaded int `json:"all_time_download"`
Uploaded int `json:"total_uploaded"`
Ratio float64 `json:"ratio"`
UploadSpeed int `json:"upload_payload_rate"`
DownloadSpeed int `json:"download_payload_rate"`
ETA int `json:"eta"`
Label string `json:"label"`
PeersConnected int `json:"num_peers"`
PeersTotal int `json:"total_peers"`
SeedsConnected int `json:"num_seeds"`
SeedsTotal int `json:"total_seeds"`
Availability float64 `json:"seeds_peers_ratio"`
QueueOrder int `json:"queue"`
Remaining int `json:"remaining"`
Status string `json:"state"`
AddedOn int `json:"added_on"`
CompletedOn int `json:"completed_on"`
FilePath string `json:"move_on_completed_path"`
AddedRaw float64 `json:"time_added"`
}
type TorrentResponse ¶
type TorrentResponse struct {
Index int `json:"id"`
Torrent Torrent `json:"result"`
Error RpcError `json:"error"`
}
TorrentResponse is an interface that allows unmarshalling of the deluge/Bittorrent api into proper golang compatible Torrent structs.
type TorrentsResponse ¶
type TorrentsResponse struct {
Index int `json:"id"`
RawTorrents map[string]Torrent `json:"result"`
Torrents []Torrent
Error RpcError `json:"error"`
}
TorrentsResponse is an interface that allows unmarshalling of the deluge/Bittorrent api into proper golang compatible Torrent structs.
func (*TorrentsResponse) UnmarshalJSON ¶
func (torrents *TorrentsResponse) UnmarshalJSON(b []byte) error
UnmarshallJSON is a custom unmarshaller for torrent lists. Necessary due to the fact uTorrent/Bittorrent does not implement a proper json api.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
add_torrent
command
|
|
|
delete_torrent
command
|
|
|
list_torrents
command
|
|
|
pause_unpause
command
|
|
|
recheck
command
|
|
|
set_properties
command
|
|
|
start_stop
command
|