Versions in this module Expand all Collapse all v4 v4.0.1 Jan 14, 2023 Changes in this version + const RPCVersion + func File2Base64(filename string) (b64 string, err error) + type AdvancedConfig struct + Debug bool + HTTPS bool + HTTPTimeout time.Duration + Port uint16 + RPCURI string + UserAgent string + type Client struct + func New(host, user, password string, conf *AdvancedConfig) (c *Client, err error) + func (c *Client) BlocklistUpdate(ctx context.Context) (nbEntries int64, err error) + func (c *Client) FreeSpace(ctx context.Context, path string) (freeSpace cunits.Bits, err error) + func (c *Client) PortTest(ctx context.Context) (open bool, err error) + func (c *Client) QueueMoveBottom(ctx context.Context, IDs []int64) (err error) + func (c *Client) QueueMoveDown(ctx context.Context, IDs []int64) (err error) + func (c *Client) QueueMoveTop(ctx context.Context, IDs []int64) (err error) + func (c *Client) QueueMoveUp(ctx context.Context, IDs []int64) (err error) + func (c *Client) RPCVersion(ctx context.Context) (ok bool, serverVersion int64, serverMinimumVersion int64, err error) + func (c *Client) SessionArgumentsGet(ctx context.Context, fields []string) (sessionArgs SessionArguments, err error) + func (c *Client) SessionArgumentsGetAll(ctx context.Context) (sessionArgs SessionArguments, err error) + func (c *Client) SessionArgumentsSet(ctx context.Context, payload SessionArguments) (err error) + func (c *Client) SessionClose(ctx context.Context) (err error) + func (c *Client) SessionStats(ctx context.Context) (stats SessionStats, err error) + func (c *Client) TorrentAdd(ctx context.Context, payload TorrentAddPayload) (torrent Torrent, err error) + func (c *Client) TorrentAddFile(ctx context.Context, filepath string) (torrent Torrent, err error) + func (c *Client) TorrentAddFileDownloadDir(ctx context.Context, filepath, downloaddir string) (torrent Torrent, err error) + func (c *Client) TorrentGet(ctx context.Context, fields []string, ids []int64) (torrents []Torrent, err error) + func (c *Client) TorrentGetAll(ctx context.Context) (torrents []Torrent, err error) + func (c *Client) TorrentGetAllFor(ctx context.Context, ids []int64) (torrents []Torrent, err error) + func (c *Client) TorrentGetAllForHashes(ctx context.Context, hashes []string) (torrents []Torrent, err error) + func (c *Client) TorrentGetHashes(ctx context.Context, fields []string, hashes []string) (torrents []Torrent, err error) + func (c *Client) TorrentReannounceHashes(ctx context.Context, hashes []string) (err error) + func (c *Client) TorrentReannounceIDs(ctx context.Context, ids []int64) (err error) + func (c *Client) TorrentReannounceRecentlyActive(ctx context.Context) (err error) + func (c *Client) TorrentRemove(ctx context.Context, payload TorrentRemovePayload) (err error) + func (c *Client) TorrentRenamePath(ctx context.Context, id int64, path, name string) (err error) + func (c *Client) TorrentRenamePathHash(ctx context.Context, hash, path, name string) (err error) + func (c *Client) TorrentSet(ctx context.Context, payload TorrentSetPayload) (err error) + func (c *Client) TorrentSetLocation(ctx context.Context, id int64, location string, move bool) (err error) + func (c *Client) TorrentSetLocationHash(ctx context.Context, hash, location string, move bool) (err error) + func (c *Client) TorrentStartHashes(ctx context.Context, hashes []string) (err error) + func (c *Client) TorrentStartIDs(ctx context.Context, ids []int64) (err error) + func (c *Client) TorrentStartNowHashes(ctx context.Context, hashes []string) (err error) + func (c *Client) TorrentStartNowIDs(ctx context.Context, ids []int64) (err error) + func (c *Client) TorrentStartNowRecentlyActive(ctx context.Context) (err error) + func (c *Client) TorrentStartRecentlyActive(ctx context.Context) (err error) + func (c *Client) TorrentStopHashes(ctx context.Context, hashes []string) (err error) + func (c *Client) TorrentStopIDs(ctx context.Context, ids []int64) (err error) + func (c *Client) TorrentStopRecentlyActive(ctx context.Context) (err error) + func (c *Client) TorrentVerifyHashes(ctx context.Context, hashes []string) (err error) + func (c *Client) TorrentVerifyIDs(ctx context.Context, ids []int64) (err error) + func (c *Client) TorrentVerifyRecentlyActive(ctx context.Context) (err error) + type CumulativeStats struct + DownloadedBytes int64 + FilesAdded int64 + SecondsActive int64 + SessionCount int64 + UploadedBytes int64 + func (cs *CumulativeStats) GetDownloaded() (downloaded cunits.Bits) + func (cs *CumulativeStats) GetUploaded() (uploaded cunits.Bits) + type CurrentStats struct + DownloadedBytes int64 + FilesAdded int64 + SecondsActive int64 + SessionCount int64 + UploadedBytes int64 + func (cs *CurrentStats) GetDownloaded() (downloaded cunits.Bits) + func (cs *CurrentStats) GetUploaded() (uploaded cunits.Bits) + type HTTPStatusCode int + func (hsc HTTPStatusCode) Error() string + type Peer struct + Address string + ClientIsChoked bool + ClientIsint64erested bool + ClientName string + FlagStr string + IsDownloadingFrom bool + IsEncrypted bool + IsIncoming bool + IsUTP bool + IsUploadingTo bool + PeerIsChoked bool + PeerIsint64erested bool + Port int64 + Progress float64 + RateToClient int64 + RateToPeer int64 + func (p *Peer) ConvertDownloadSpeed() (speed cunits.Bits) + func (p *Peer) ConvertUploadSpeed() (speed cunits.Bits) + type SeedRatioMode int64 + const SeedRatioModeCustom + const SeedRatioModeGlobal + const SeedRatioModeNoRatio + func (srm SeedRatioMode) GoString() string + func (srm SeedRatioMode) String() string + type SessionArguments struct + AltSpeedDown *int64 + AltSpeedEnabled *bool + AltSpeedTimeBegin *int64 + AltSpeedTimeDay *int64 + AltSpeedTimeEnabled *bool + AltSpeedTimeEnd *int64 + AltSpeedUp *int64 + BlocklistEnabled *bool + BlocklistSize *int64 + BlocklistURL *string + CacheSizeMB *int64 + ConfigDir *string + DHTEnabled *bool + DownloadDir *string + DownloadQueueEnabled *bool + DownloadQueueSize *int64 + Encryption *string + IdleSeedingLimit *int64 + IdleSeedingLimitEnabled *bool + IncompleteDir *string + IncompleteDirEnabled *bool + LPDEnabled *bool + PEXEnabled *bool + PeerLimitGlobal *int64 + PeerLimitPerTorrent *int64 + PeerPort *int64 + PeerPortRandomOnStart *bool + PortForwardingEnabled *bool + QueueStalledEnabled *bool + QueueStalledMinutes *int64 + RPCVersion *int64 + RPCVersionMinimum *int64 + RenamePartialFiles *bool + ScriptTorrentDoneEnabled *bool + ScriptTorrentDoneFilename *string + SeedQueueEnabled *bool + SeedQueueSize *int64 + SeedRatioLimit *float64 + SeedRatioLimited *bool + SessionID *string + SpeedLimitDown *int64 + SpeedLimitDownEnabled *bool + SpeedLimitUp *int64 + SpeedLimitUpEnabled *bool + StartAddedTorrents *bool + TrashOriginalTorrentFiles *bool + UTPEnabled *bool + Units *Units + Version *string + func (sa SessionArguments) MarshalJSON() (data []byte, err error) + type SessionStats struct + ActiveTorrentCount int64 + CumulativeStats CumulativeStats + CurrentStats CurrentStats + DownloadSpeed int64 + PausedTorrentCount int64 + TorrentCount int64 + UploadSpeed int64 + type Torrent struct + ActivityDate *time.Time + AddedDate *time.Time + BandwidthPriority *int64 + Comment *string + CorruptEver *int64 + Creator *string + DateCreated *time.Time + DesiredAvailable *int64 + DoneDate *time.Time + DownloadDir *string + DownloadLimit *int64 + DownloadLimited *bool + DownloadedEver *int64 + EditDate *time.Time + Error *int64 + ErrorString *string + Eta *int64 + EtaIdle *int64 + FileStats []*TorrentFileStat + Files []*TorrentFile + HashString *string + HaveUnchecked *int64 + HaveValid *int64 + HonorsSessionLimits *bool + ID *int64 + IsFinished *bool + IsPrivate *bool + IsStalled *bool + Labels []string + LeftUntilDone *int64 + MagnetLink *string + ManualAnnounceTime *int64 + MaxConnectedPeers *int64 + MetadataPercentComplete *float64 + Name *string + PeerLimit *int64 + Peers []*Peer + PeersConnected *int64 + PeersFrom *TorrentPeersFrom + PeersGettingFromUs *int64 + PeersSendingToUs *int64 + PercentDone *float64 + PieceCount *int64 + PieceSize *cunits.Bits + Pieces *string + Priorities []int64 + QueuePosition *int64 + RateDownload *int64 + RateUpload *int64 + RecheckProgress *float64 + SecondsDownloading *int64 + SecondsSeeding *time.Duration + SeedIdleLimit *int64 + SeedIdleMode *int64 + SeedRatioLimit *float64 + SeedRatioMode *SeedRatioMode + SizeWhenDone *cunits.Bits + StartDate *time.Time + Status *TorrentStatus + TorrentFile *string + TotalSize *cunits.Bits + TrackerStats []*TrackerStats + Trackers []*Tracker + UploadLimit *int64 + UploadLimited *bool + UploadRatio *float64 + UploadedEver *int64 + Wanted []bool + WebSeeds []string + WebSeedsSendingToUs *int64 + func (t *Torrent) ConvertDownloadSpeed() (speed cunits.Bits) + func (t *Torrent) ConvertUploadSpeed() (speed cunits.Bits) + func (t *Torrent) UnmarshalJSON(data []byte) (err error) + func (t Torrent) MarshalJSON() (data []byte, err error) + type TorrentAddPayload struct + BandwidthPriority *int64 + Cookies *string + DownloadDir *string + Filename *string + FilesUnwanted []int64 + FilesWanted []int64 + MetaInfo *string + Paused *bool + PeerLimit *int64 + PriorityHigh []int64 + PriorityLow []int64 + PriorityNormal []int64 + func (tap TorrentAddPayload) MarshalJSON() (data []byte, err error) + type TorrentFile struct + BytesCompleted int64 + Length int64 + Name string + type TorrentFileStat struct + BytesCompleted int64 + Priority int64 + Wanted bool + type TorrentPeersFrom struct + FromCache int64 + FromDHT int64 + FromIncoming int64 + FromLPD int64 + FromLTEP int64 + FromPEX int64 + FromTracker int64 + type TorrentRemovePayload struct + DeleteLocalData bool + IDs []int64 + type TorrentSetPayload struct + BandwidthPriority *int64 + DownloadLimit *int64 + DownloadLimited *bool + FilesUnwanted []int64 + FilesWanted []int64 + HonorsSessionLimits *bool + IDs []int64 + Labels []string + Location *string + PeerLimit *int64 + PriorityHigh []int64 + PriorityLow []int64 + PriorityNormal []int64 + QueuePosition *int64 + SeedIdleLimit *time.Duration + SeedIdleMode *int64 + SeedRatioLimit *float64 + SeedRatioMode *SeedRatioMode + TrackerAdd []string + TrackerRemove []int64 + TrackerReplace []string + UploadLimit *int64 + UploadLimited *bool + func (tsp TorrentSetPayload) MarshalJSON() (data []byte, err error) + type TorrentStatus int64 + const TorrentStatusCheck + const TorrentStatusCheckWait + const TorrentStatusDownload + const TorrentStatusDownloadWait + const TorrentStatusIsolated + const TorrentStatusSeed + const TorrentStatusSeedWait + const TorrentStatusStopped + func (status TorrentStatus) GoString() string + func (status TorrentStatus) String() string + type Tracker struct + Announce string + ID int64 + Scrape string + Tier int64 + type TrackerStats struct + Announce string + AnnounceState int64 + DownloadCount int64 + HasAnnounced bool + HasScraped bool + Host string + ID int64 + IsBackup bool + LastAnnouncePeerCount int64 + LastAnnounceResult string + LastAnnounceStartTime time.Time + LastAnnounceSucceeded bool + LastAnnounceTime time.Time + LastAnnounceTimedOut bool + LastScrapeResult string + LastScrapeStartTime time.Time + LastScrapeSucceeded bool + LastScrapeTime time.Time + LastScrapeTimedOut bool + LeecherCount int64 + NextAnnounceTime time.Time + NextScrapeTime time.Time + Scrape string + ScrapeState int64 + SeederCount int64 + Tier int64 + func (ts *TrackerStats) UnmarshalJSON(data []byte) (err error) + func (ts TrackerStats) MarshalJSON() (data []byte, err error) + type TransmissionFreeSpace struct + Path string + Size int64 + type Units struct + MemoryBytes int64 + MemoryUnits []string + SizeBytes int64 + SizeUnits []string + SpeedBytes int64 + SpeedUnits []string + func (u *Units) GetMemory() (memory cunits.Bits) + func (u *Units) GetSize() (size cunits.Bits) + func (u *Units) GetSpeed() (speed cunits.Bits)