Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client connects to transmission via HTTP
func (*Client) GetSession ¶
GetSession gets the current session from transmission
func (*Client) GetSessionStats ¶
func (c *Client) GetSessionStats() (*SessionStats, error)
GetSessionStats gets stats on the current & cumulative session
func (*Client) GetTorrents ¶
GetTorrents get a list of torrents
type File ¶
type File struct { BytesCompleted int64 `json:"bytesCompleted"` Length int64 `json:"length"` Name string `json:"name"` }
File is a file contained inside a torrent
type FileStat ¶
type FileStat struct { BytesCompleted int64 `json:"bytesCompleted"` Priority int `json:"priority"` Wanted bool `json:"wanted"` }
FileStat describe a file's priority & if it's wanted
type Peer ¶
type Peer struct { Address string `json:"address"` ClientIsChoked bool `json:"clientIsChoked"` ClientIsInterested bool `json:"clientIsInterested"` ClientName string `json:"clientName"` FlagStr string `json:"flagStr"` IsDownloadingFrom bool `json:"isDownloadingFrom"` IsEncrypted bool `json:"isEncrypted"` IsIncoming bool `json:"isIncoming"` IsUTP bool `json:"isUTP"` IsUploadingTo bool `json:"isUploadingTo"` PeerIsChoked bool `json:"peerIsChoked"` PeerIsInterested bool `json:"peerIsInterested"` Port int `json:"port"` Progress float64 `json:"progress"` RateToClient int `json:"rateToClient"` RateToPeer int `json:"rateToPeer"` }
Peer of a torrent
type Session ¶
type Session struct { AltSpeedDown int `json:"alt-speed-down"` AltSpeedEnabled bool `json:"alt-speed-enabled"` //Alt_speed_time_begin int `json:"alt-speed-time-begin"` //Alt_speed_time_day int `json:"alt-speed-time-day"` //Alt_speed_time_enabled bool `json:"alt-speed-time-enabled"` //Alt_speed_time_end int `json:"alt-speed-time-end"` AltSpeedUp int `json:"alt-speed-up"` //Blocklist_enabled bool `json:"blocklist-enabled"` //Blocklist_size int `json:"blocklist-size"` //Blocklist_url string `json:"blocklist-url"` CacheSizeMB int `json:"cache-size-mb"` //Config_dir string `json:"config-dir"` //Dht_enabled bool `json:"dht-enabled"` DownloadDir string `json:"download-dir"` DownloadDirFreeSpace int64 `json:"download-dir-free-space"` DownloadQueueEnabled bool `json:"download-queue-enabled"` DownloadQueueSize int `json:"download-queue-size"` //Encryption string `json:"encryption"` //Idle_seeding_limit int `json:"idle-seeding-limit"` //Idle_seeding_limit_enabled bool `json:"idle-seeding-limit-enabled"` IncompleteDir string `json:"incomplete-dir"` //Incomplete_dir_enabled bool `json:"incomplete-dir-enabled"` //Lpd_enabled bool `json:"lpd-enabled"` PeerLimitGlobal int `json:"peer-limit-global"` PeerLimitPerTorrent int `json:"peer-limit-per-torrent"` //Peer_port int `json:"peer-port"` //Peer_port_random_on_start bool `json:"peer-port-random-on-start"` //Pex_enabled bool `json:"pex-enabled"` //Port_forwarding_enabled bool `json:"port-forwarding-enabled"` //Queue_stalled_enabled bool `json:"queue-stalled-enabled"` //Queue_stalled_minutes int `json:"queue-stalled-minutes"` //Rename_partial_files bool `json:"rename-partial-files"` //RPC_version int `json:"rpc-version"` //RPC_version_minimum int `json:"rpc-version-minimum"` //Script_torrent_done_enabled bool `json:"script-torrent-done-enabled"` //Script_torrent_done_filename string `json:"script-torrent-done-filename"` SeedQueueEnabled bool `json:"seed-queue-enabled"` SeedQueueSize int `json:"seed-queue-size"` SeedRatioLimit float64 `json:"seedRatioLimit"` SeedRatioLimited bool `json:"seedRatioLimited"` SpeedLimitDown int `json:"speed-limit-down"` SpeedLimitDownEnabled bool `json:"speed-limit-down-enabled"` SpeedLimitUp int `json:"speed-limit-up"` SpeedLimitUpEnabled bool `json:"speed-limit-up-enabled"` //Start_added_torrents bool `json:"start-added-torrents"` //Trash_original_torrent_files bool `json:"trash-original-torrent-files"` //Utp_enabled bool `json:"utp-enabled"` Version string `json:"version"` }
Session information about the current transmission session
type SessionCommand ¶
type SessionCommand struct { Method string `json:"method,omitempty"` Session Session `json:"arguments,omitempty"` Result string `json:"result,omitempty"` }
SessionCommand is the root command to interact with Transmission via RPC
type SessionStateStats ¶
type SessionStateStats struct { DownloadedBytes int64 `json:"downloadedBytes"` UploadedBytes int64 `json:"uploadedBytes"` FilesAdded int64 `json:"filesAdded"` SecondsActive int64 `json:"secondsActive"` SessionCount int64 `json:"sessionCount"` }
SessionStateStats contains current or cumulative session stats
type SessionStats ¶
type SessionStats struct { DownloadSpeed int64 `json:"downloadSpeed"` UploadSpeed int64 `json:"uploadSpeed"` ActiveTorrentCount int `json:"activeTorrentCount"` PausedTorrentCount int `json:"pausedTorrentCount"` TorrentCount int `json:"torrentCount"` CumulativeStats SessionStateStats `json:"cumulative-stats"` CurrentStats SessionStateStats `json:"current-stats"` }
SessionStats contains information about the current & cumulative session
type SessionStatsCmd ¶
type SessionStatsCmd struct { SessionStats `json:"arguments"` Result string `json:"result"` }
SessionStatsCmd is the root command to interact with Transmission via RPC
type Torrent ¶
type Torrent struct { ID int `json:"id"` Name string `json:"name"` Status int `json:"status"` Added int `json:"addedDate"` LeftUntilDone int64 `json:"leftUntilDone"` Eta int `json:"eta"` UploadRatio float64 `json:"uploadRatio"` RateDownload int `json:"rateDownload"` RateUpload int `json:"rateUpload"` DownloadDir string `json:"downloadDir"` IsFinished bool `json:"isFinished"` PercentDone float64 `json:"percentDone"` SeedRatioMode int `json:"seedRatioMode"` HashString string `json:"hashString"` Error int `json:"error"` ErrorString string `json:"errorString"` Files []File `json:"files"` FilesStats []FileStat `json:"fileStats"` TrackerStats []TrackerStat `json:"trackerStats"` Peers []Peer `json:"peers"` PeersConnected int `json:"peersConnected"` PeersGettingFromUs int `json:"peersGettingFromUs"` TotalSize int `json:"totalSize"` UploadedEver int `json:"uploadedEver"` }
Torrent represents a transmission torrent
type TorrentArguments ¶
type TorrentArguments struct { Fields []string `json:"fields,omitempty"` Torrents []Torrent `json:"torrents,omitempty"` Ids []int `json:"ids,omitempty"` DeleteData bool `json:"delete-local-data,omitempty"` DownloadDir string `json:"download-dir,omitempty"` MetaInfo string `json:"metainfo,omitempty"` Filename string `json:"filename,omitempty"` TorrentAdded TorrentArgumentsAdded `json:"torrent-added"` }
TorrentArguments specifies the TorrentCommand in more detail
type TorrentArgumentsAdded ¶
type TorrentArgumentsAdded struct { HashString string `json:"hashString"` ID int64 `json:"id"` Name string `json:"name"` }
TorrentArgumentsAdded specifies the torrent to get added data from
type TorrentCommand ¶
type TorrentCommand struct { Method string `json:"method,omitempty"` Arguments TorrentArguments `json:"arguments,omitempty"` Result string `json:"result,omitempty"` }
TorrentCommand is the root command to interact with Transmission via RPC
type TrackerStat ¶
type TrackerStat struct { Announce string `json:"announce"` AnnounceState int `json:"announceState"` DownloadCount int `json:"downloadCount"` HasAnnounced bool `json:"hasAnnounced"` HasScraped bool `json:"hasScraped"` Host string `json:"host"` ID int `json:"id"` IsBackup bool `json:"isBackup"` LastAnnouncePeerCount int `json:"lastAnnouncePeerCount"` LastAnnounceResult string `json:"lastAnnounceResult"` LastAnnounceStartTime int `json:"lastAnnounceStartTime"` LastAnnounceSucceeded bool `json:"lastAnnounceSucceeded"` LastAnnounceTime int `json:"lastAnnounceTime"` LastAnnounceTimedOut bool `json:"lastAnnounceTimedOut"` LastScrapeResult string `json:"lastScrapeResult"` LastScrapeStartTime int `json:"lastScrapeStartTime"` LastScrapeSucceeded bool `json:"lastScrapeSucceeded"` LastScrapeTime int `json:"lastScrapeTime"` LastScrapeTimedOut bool `json:"lastScrapeTimedOut"` LeecherCount int `json:"leecherCount"` NextAnnounceTime int `json:"nextAnnounceTime"` NextScrapeTime int `json:"nextScrapeTime"` Scrape string `json:"scrape"` ScrapeState int `json:"scrapeState"` SeederCount int `json:"seederCount"` Tier int `json:"tier"` }
TrackerStat has stats about the torrent's tracker