Versions in this module Expand all Collapse all v1 v1.9.4 Nov 6, 2024 Changes in this version type Client + func (c *Client) Start(hashes []string) error + func (c *Client) StartCtx(ctx context.Context, hashes []string) error + func (c *Client) Stop(hashes []string) error + func (c *Client) StopCtx(ctx context.Context, hashes []string) error type TorrentState + const TorrentStateStoppedDl + const TorrentStateStoppedUp v1.9.3 Jun 6, 2024 v1.9.2 Jun 6, 2024 Changes in this version type ShareLimits + InactiveSeedingTime int64 + SeedingTime int64 v1.9.1 Jun 6, 2024 Changes in this version + const ConnectionStatusConnected + const ConnectionStatusDisconnected + const ConnectionStatusFirewalled + const ReannounceInterval + const ReannounceMaxAttempts + var DefaultTimeout = 60 * time.Second + var ErrReannounceTookTooLong = errors.New("reannounce took too long, deleted torrent") + type AppPreferences struct + AddTrackers string + AddTrackersEnabled bool + AltDlLimit int + AltUpLimit int + AlternativeWebuiEnabled bool + AlternativeWebuiPath string + AnnounceIP string + AnnounceToAllTiers bool + AnnounceToAllTrackers bool + AnonymousMode bool + AsyncIoThreads int + AutoDeleteMode int + AutoTmmEnabled bool + AutorunEnabled bool + AutorunOnTorrentAddedEnabled bool + AutorunOnTorrentAddedProgram string + AutorunProgram string + BannedIPs string + BittorrentProtocol int + BlockPeersOnPrivilegedPorts bool + BypassAuthSubnetWhitelist string + BypassAuthSubnetWhitelistEnabled bool + BypassLocalAuth bool + CategoryChangedTmmEnabled bool + CheckingMemoryUse int + ConnectionSpeed int + CurrentInterfaceAddress string + CurrentNetworkInterface string + Dht bool + DiskCache int + DiskCacheTTL int + DiskIoReadMode int + DiskIoType int + DiskIoWriteMode int + DiskQueueSize int + DlLimit int + DontCountSlowTorrents bool + DyndnsDomain string + DyndnsEnabled bool + DyndnsPassword string + DyndnsService int + DyndnsUsername string + EmbeddedTrackerPort int + EmbeddedTrackerPortForwarding bool + EnableCoalesceReadWrite bool + EnableEmbeddedTracker bool + EnableMultiConnectionsFromSameIP bool + EnablePieceExtentAffinity bool + EnableUploadSuggestions bool + Encryption int + ExcludedFileNames string + ExcludedFileNamesEnabled bool + ExportDir string + ExportDirFin string + FilePoolSize int + HashingThreads int + IPFilterEnabled bool + IPFilterPath string + IPFilterTrackers bool + IdnSupportEnabled bool + IncompleteFilesExt bool + LimitLanPeers bool + LimitTCPOverhead bool + LimitUtpRate bool + ListenPort int + Locale string + Lsd bool + MailNotificationAuthEnabled bool + MailNotificationEmail string + MailNotificationEnabled bool + MailNotificationPassword string + MailNotificationSMTP string + MailNotificationSender string + MailNotificationSslEnabled bool + MailNotificationUsername string + MaxActiveCheckingTorrents int + MaxActiveDownloads int + MaxActiveTorrents int + MaxActiveUploads int + MaxConcurrentHTTPAnnounces int + MaxConnec int + MaxConnecPerTorrent int + MaxRatio int + MaxRatioAct int + MaxRatioEnabled bool + MaxSeedingTime int + MaxSeedingTimeEnabled bool + MaxUploads int + MaxUploadsPerTorrent int + MemoryWorkingSetLimit int + OutgoingPortsMax int + OutgoingPortsMin int + PeerTos int + PeerTurnover int + PeerTurnoverCutoff int + PeerTurnoverInterval int + PerformanceWarning bool + Pex bool + PreallocateAll bool + ProxyAuthEnabled bool + ProxyHostnameLookup bool + ProxyIP string + ProxyPassword string + ProxyPeerConnections bool + ProxyPort int + ProxyTorrentsOnly bool + ProxyType interface{} + ProxyUsername string + QueueingEnabled bool + RandomPort bool + ReannounceWhenAddressChanged bool + RecheckCompletedTorrents bool + RefreshInterval int + RequestQueueSize int + ResolvePeerCountries bool + ResumeDataStorageType string + RssAutoDownloadingEnabled bool + RssDownloadRepackProperEpisodes bool + RssMaxArticlesPerFeed int + RssProcessingEnabled bool + RssRefreshInterval int + RssSmartEpisodeFilters string + SavePath string + SavePathChangedTmmEnabled bool + SaveResumeDataInterval int + ScanDirs struct{} + ScheduleFromHour int + ScheduleFromMin int + ScheduleToHour int + ScheduleToMin int + SchedulerDays int + SchedulerEnabled bool + SendBufferLowWatermark int + SendBufferWatermark int + SendBufferWatermarkFactor int + SlowTorrentDlRateThreshold int + SlowTorrentInactiveTimer int + SlowTorrentUlRateThreshold int + SocketBacklogSize int + SsrfMitigation bool + StartPausedEnabled bool + StopTrackerTimeout int + TempPath string + TempPathEnabled bool + TorrentChangedTmmEnabled bool + TorrentContentLayout string + TorrentStopCondition string + UpLimit int + UploadChokingAlgorithm int + UploadSlotsBehavior int + Upnp bool + UpnpLeaseDuration int + UseCategoryPathsInManualMode bool + UseHTTPS bool + UtpTCPMixedMode int + ValidateHTTPSTrackerCertificate bool + WebUIAddress string + WebUIBanDuration int + WebUIClickjackingProtectionEnabled bool + WebUICsrfProtectionEnabled bool + WebUICustomHTTPHeaders string + WebUIDomainList string + WebUIHTTPSCertPath string + WebUIHTTPSKeyPath string + WebUIHostHeaderValidationEnabled bool + WebUIMaxAuthFailCount int + WebUIPort int + WebUIReverseProxiesList string + WebUIReverseProxyEnabled bool + WebUISecureCookieEnabled bool + WebUISessionTimeout int + WebUIUpnp bool + WebUIUseCustomHTTPHeadersEnabled bool + WebUIUsername string + type Category struct + Name string + SavePath string + type Client struct + func NewClient(cfg Config) *Client + func (c *Client) AddTags(hashes []string, tags string) error + func (c *Client) AddTagsCtx(ctx context.Context, hashes []string, tags string) error + func (c *Client) AddTorrentFromFile(filePath string, options map[string]string) error + func (c *Client) AddTorrentFromFileCtx(ctx context.Context, filePath string, options map[string]string) error + func (c *Client) AddTorrentFromMemory(buf []byte, options map[string]string) error + func (c *Client) AddTorrentFromMemoryCtx(ctx context.Context, buf []byte, options map[string]string) error + func (c *Client) AddTorrentFromUrl(url string, options map[string]string) error + func (c *Client) AddTorrentFromUrlCtx(ctx context.Context, url string, options map[string]string) error + func (c *Client) CreateCategory(category string, path string) error + func (c *Client) CreateCategoryCtx(ctx context.Context, category string, path string) error + func (c *Client) CreateTags(tags []string) error + func (c *Client) CreateTagsCtx(ctx context.Context, tags []string) error + func (c *Client) DecreasePriority(hashes []string) error + func (c *Client) DecreasePriorityCtx(ctx context.Context, hashes []string) error + func (c *Client) DeleteTags(tags []string) error + func (c *Client) DeleteTagsCtx(ctx context.Context, tags []string) error + func (c *Client) DeleteTorrents(hashes []string, deleteFiles bool) error + func (c *Client) DeleteTorrentsCtx(ctx context.Context, hashes []string, deleteFiles bool) error + func (c *Client) EditCategory(category string, path string) error + func (c *Client) EditCategoryCtx(ctx context.Context, category string, path string) error + func (c *Client) EditTracker(hash string, old, new string) error + func (c *Client) EditTrackerCtx(ctx context.Context, hash string, old, new string) error + func (c *Client) ExportTorrent(hash string) ([]byte, error) + func (c *Client) ExportTorrentCtx(ctx context.Context, hash string) ([]byte, error) + func (c *Client) GetAppPreferences() (AppPreferences, error) + func (c *Client) GetAppPreferencesCtx(ctx context.Context) (AppPreferences, error) + func (c *Client) GetAppVersion() (string, error) + func (c *Client) GetAppVersionCtx(ctx context.Context) (string, error) + func (c *Client) GetCategories() (map[string]Category, error) + func (c *Client) GetCategoriesCtx(ctx context.Context) (map[string]Category, error) + func (c *Client) GetFilesInformation(hash string) (*TorrentFiles, error) + func (c *Client) GetFilesInformationCtx(ctx context.Context, hash string) (*TorrentFiles, error) + func (c *Client) GetTags() ([]string, error) + func (c *Client) GetTagsCtx(ctx context.Context) ([]string, error) + func (c *Client) GetTorrentProperties(hash string) (TorrentProperties, error) + func (c *Client) GetTorrentPropertiesCtx(ctx context.Context, hash string) (TorrentProperties, error) + func (c *Client) GetTorrentTrackers(hash string) ([]TorrentTracker, error) + func (c *Client) GetTorrentTrackersCtx(ctx context.Context, hash string) ([]TorrentTracker, error) + func (c *Client) GetTorrents(o TorrentFilterOptions) ([]Torrent, error) + func (c *Client) GetTorrentsActiveDownloads() ([]Torrent, error) + func (c *Client) GetTorrentsActiveDownloadsCtx(ctx context.Context) ([]Torrent, error) + func (c *Client) GetTorrentsCtx(ctx context.Context, o TorrentFilterOptions) ([]Torrent, error) + func (c *Client) GetTorrentsRaw() (string, error) + func (c *Client) GetTorrentsRawCtx(ctx context.Context) (string, error) + func (c *Client) GetTransferInfo() (*TransferInfo, error) + func (c *Client) GetTransferInfoCtx(ctx context.Context) (*TransferInfo, error) + func (c *Client) GetWebAPIVersion() (string, error) + func (c *Client) GetWebAPIVersionCtx(ctx context.Context) (string, error) + func (c *Client) IncreasePriority(hashes []string) error + func (c *Client) IncreasePriorityCtx(ctx context.Context, hashes []string) error + func (c *Client) Login() error + func (c *Client) LoginCtx(ctx context.Context) error + func (c *Client) Pause(hashes []string) error + func (c *Client) PauseCtx(ctx context.Context, hashes []string) error + func (c *Client) ReAnnounceTorrents(hashes []string) error + func (c *Client) ReAnnounceTorrentsCtx(ctx context.Context, hashes []string) error + func (c *Client) ReannounceTorrentWithRetry(ctx context.Context, hash string, opts *ReannounceOptions) error + func (c *Client) Recheck(hashes []string) error + func (c *Client) RecheckCtx(ctx context.Context, hashes []string) error + func (c *Client) RemoveCategories(categories []string) error + func (c *Client) RemoveCategoriesCtx(ctx context.Context, categories []string) error + func (c *Client) RemoveTags(hashes []string, tags string) error + func (c *Client) RemoveTagsCtx(ctx context.Context, hashes []string, tags string) error + func (c *Client) RenameFile(hash, oldPath, newPath string) error + func (c *Client) RenameFileCtx(ctx context.Context, hash, oldPath, newPath string) error + func (c *Client) Resume(hashes []string) error + func (c *Client) ResumeCtx(ctx context.Context, hashes []string) error + func (c *Client) SetAutoManagement(hashes []string, enable bool) error + func (c *Client) SetAutoManagementCtx(ctx context.Context, hashes []string, enable bool) error + func (c *Client) SetCategory(hashes []string, category string) error + func (c *Client) SetCategoryCtx(ctx context.Context, hashes []string, category string) error + func (c *Client) SetForceStart(hashes []string, value bool) error + func (c *Client) SetForceStartCtx(ctx context.Context, hashes []string, value bool) error + func (c *Client) SetLocation(hashes []string, location string) error + func (c *Client) SetLocationCtx(ctx context.Context, hashes []string, location string) error + func (c *Client) SetMaxPriority(hashes []string) error + func (c *Client) SetMaxPriorityCtx(ctx context.Context, hashes []string) error + func (c *Client) SetMinPriority(hashes []string) error + func (c *Client) SetMinPriorityCtx(ctx context.Context, hashes []string) error + func (c *Client) SetPreferences(prefs map[string]interface{}) error + func (c *Client) SetPreferencesCtx(ctx context.Context, prefs map[string]interface{}) error + func (c *Client) SetPreferencesMaxActiveDownloads(max int) error + func (c *Client) SetPreferencesMaxActiveTorrents(max int) error + func (c *Client) SetPreferencesMaxActiveUploads(max int) error + func (c *Client) SetPreferencesQueueingEnabled(enabled bool) error + func (c *Client) SetShareLimits(hashes []string, limit ShareLimits) error + func (c *Client) SetShareLimitsCtx(ctx context.Context, hashes []string, limit ShareLimits) error + func (c *Client) ToggleFirstLastPiecePrio(hashes []string) error + func (c *Client) ToggleFirstLastPiecePrioCtx(ctx context.Context, hashes []string) error + type Config struct + BasicPass string + BasicUser string + Host string + Log *log.Logger + Password string + TLSSkipVerify bool + Timeout int + Username string + type ConnectionStatus string + type ContentLayout string + const ContentLayoutOriginal + const ContentLayoutSubfolderCreate + const ContentLayoutSubfolderNone + type ReannounceOptions struct + DeleteOnFailure bool + Interval int + MaxAttempts int + type ShareLimits struct + InactiveSeedTime int64 + Ratio float64 + SeedTime int64 + func (l ShareLimits) Prepare() map[string]string + type Torrent struct + AddedOn int64 + AmountLeft int64 + AutoManaged bool + Availability float64 + Category string + Completed int64 + CompletionOn int64 + ContentPath string + DlLimit int64 + DlSpeed int64 + DownloadPath string + Downloaded int64 + DownloadedSession int64 + ETA int64 + FirstLastPiecePrio bool + ForceStart bool + Hash string + InfohashV1 string + InfohashV2 string + LastActivity int64 + MagnetURI string + MaxRatio float64 + MaxSeedingTime int64 + Name string + NumComplete int64 + NumIncomplete int64 + NumLeechs int64 + NumSeeds int64 + Priority int64 + Progress float64 + Ratio float64 + RatioLimit float64 + SavePath string + SeedingTime int64 + SeedingTimeLimit int64 + SeenComplete int64 + SequentialDownload bool + Size int64 + State TorrentState + SuperSeeding bool + Tags string + TimeActive int64 + TotalSize int64 + Tracker string + TrackersCount int64 + UpLimit int64 + UpSpeed int64 + Uploaded int64 + UploadedSession int64 + type TorrentAddOptions struct + AutoTMM bool + Category string + ContentLayout ContentLayout + FirstLastPiecePrio bool + LimitDownloadSpeed int64 + LimitRatio float64 + LimitSeedTime int64 + LimitUploadSpeed int64 + Paused bool + Rename string + SavePath string + SkipHashCheck bool + Tags string + func (o *TorrentAddOptions) Prepare() map[string]string + type TorrentFiles []struct + type TorrentFilter string + const TorrentFilterActive + const TorrentFilterAll + const TorrentFilterCompleted + const TorrentFilterDownloading + const TorrentFilterError + const TorrentFilterInactive + const TorrentFilterPaused + const TorrentFilterResumed + const TorrentFilterStalled + const TorrentFilterStalledDownloading + const TorrentFilterStalledUploading + const TorrentFilterUploading + type TorrentFilterOptions struct + Category string + Filter TorrentFilter + Hashes []string + Limit int + Offset int + Reverse bool + Sort string + Tag string + type TorrentProperties struct + AdditionDate int + Comment string + CompletionDate int + CreatedBy string + CreationDate int + DlLimit int + DlSpeed int + DlSpeedAvg int + DownloadPath string + Eta int + Hash string + InfohashV1 string + InfohashV2 string + IsPrivate bool + LastSeen int + Name string + NbConnections int + NbConnectionsLimit int + Peers int + PeersTotal int + PieceSize int + PiecesHave int + PiecesNum int + Reannounce int + SavePath string + SeedingTime int + Seeds int + SeedsTotal int + ShareRatio float64 + TimeElapsed int + TotalDownloaded int64 + TotalDownloadedSession int64 + TotalSize int64 + TotalUploaded int64 + TotalUploadedSession int64 + TotalWasted int64 + UpLimit int + UpSpeed int + UpSpeedAvg int + type TorrentState string + const TorrentStateAllocating + const TorrentStateCheckingDl + const TorrentStateCheckingResumeData + const TorrentStateCheckingUp + const TorrentStateDownloading + const TorrentStateError + const TorrentStateForcedDl + const TorrentStateForcedUp + const TorrentStateMetaDl + const TorrentStateMissingFiles + const TorrentStateMoving + const TorrentStatePausedDl + const TorrentStatePausedUp + const TorrentStateQueuedDl + const TorrentStateQueuedUp + const TorrentStateStalledDl + const TorrentStateStalledUp + const TorrentStateUnknown + const TorrentStateUploading + type TorrentTracker struct + Message string + NumDownloaded int + NumLeechers int + NumPeers int + NumSeeds int + Status TrackerStatus + Url string + type TorrentTrackersResponse struct + Trackers []TorrentTracker + type TrackerStatus int + const TrackerStatusDisabled + const TrackerStatusNotContacted + const TrackerStatusNotWorking + const TrackerStatusOK + const TrackerStatusUpdating + type TransferInfo struct + ConnectionStatus ConnectionStatus + DHTNodes int64 + DlInfoData int64 + DlInfoSpeed int64 + DlRateLimit int64 + UpInfoData int64 + UpInfoSpeed int64 + UpRateLimit int64