Documentation
¶
Index ¶
- 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) SetTorrentProperty(hash string, property string, value 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 Torrent
- type TorrentList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 uTorrent/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) SetTorrentProperty ¶
SetTorrentProperty sets a property 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 Torrent ¶
type Torrent struct {
Hash string `json:"hash"`
StatusCode int `json:"status_code"`
Name string `json:"name"`
Size int `json:"size"`
PercentProgress int `json:"percent_progress"`
Downloaded int `json:"downloaded"`
Uploaded int `json:"uploaded"`
Ratio int `json:"ratio"`
UploadSpeed int `json:"upload_speed"`
DownloadSpeed int `json:"download_speed"`
ETA int `json:"eta"`
Label string `json:"label"`
PeersConnected int `json:"peers_connected"`
PeersTotal int `json:"peers_total"`
SeedsConnected int `json:"seeds_connected"`
SeedsTotal int `json:"seeds_total"`
Availability int `json:"availability"`
QueueOrder int `json:"queue_order"`
Remaining int `json:"remaining"`
Status string `json:"status"`
AddedOn int `json:"added_on"`
CompletedOn int `json:"completed_on"`
FilePath string `json:"filepath"`
}
type TorrentList ¶
type TorrentList struct {
Build int `json:"build"`
RawTorrents [][]interface{} `json:"torrents"`
Torrents []Torrent
TorrentCache string `json:"torrentc"`
}
TorrentList is an interface that allows unmarshalling of the uTorrent/Bittorrent api into proper golang compatible Torrent structs.
func (*TorrentList) UnmarshalJSON ¶
func (torrents *TorrentList) 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
|