Versions in this module Expand all Collapse all v1 v1.0.0 Aug 19, 2026 Changes in this version + const ErrorLocalError + const ErrorNone + const ErrorTrackerError + const ErrorTrackerWarning + const PriorityHigh + const PriorityLow + const PriorityNormal + const SeedIdleModeCustom + const SeedIdleModeGlobal + const SeedIdleModeUnlimited + const SeedRatioModeCustom + const SeedRatioModeGlobal + const SeedRatioModeUnlimited + const StatusCheckPending + const StatusChecking + const StatusDownloadPending + const StatusDownloading + const StatusSeedPending + const StatusSeeding + const StatusStopped + type AddTorrentOptions struct + BandwidthPriority *int + Cookies *string + DownloadDir *string + Filename *string + FilesUnwanted []int + FilesWanted []int + Labels []string + MetaInfo *string + Paused *bool + PeerLimit *int + PriorityHigh []int + PriorityLow []int + PriorityNormal []int + type ApiClient struct + func NewClient(url, username, password string) *ApiClient + func (ac *ApiClient) Post(body string) ([]byte, error) + type Client struct + func New(rawURL, username, password string, opts ...Option) (*Client, error) + func (c *Client) AddTorrent(ctx context.Context, opt AddTorrentOptions) (*TorrentAdded, error) + func (c *Client) AddTorrentByData(ctx context.Context, data []byte) (*TorrentAdded, error) + func (c *Client) AddTorrentByFile(ctx context.Context, filePath string) (*TorrentAdded, error) + func (c *Client) AddTorrentByURL(ctx context.Context, url string) (*TorrentAdded, error) + func (c *Client) CloseSession(ctx context.Context) error + func (c *Client) DeleteTorrent(id int, deleteData bool) (string, error) + func (c *Client) Execute(ctx context.Context, method string, args any, result any) error + func (c *Client) ExecuteAddCommand(addCmd *Command) (TorrentAdded, error) + func (c *Client) ExecuteCommand(cmd *Command) (*Command, error) + func (c *Client) FreeSpace(ctx context.Context, path string) (freeBytes int64, totalBytes int64, err error) + func (c *Client) GetRecentlyActive(ctx context.Context, fields ...string) (active Torrents, removedIDs []int, err error) + func (c *Client) GetSession(ctx context.Context) (*Session, error) + func (c *Client) GetStats(ctx ...context.Context) (*Stats, error) + func (c *Client) GetTorrent(id int, ctx ...context.Context) (*Torrent, error) + func (c *Client) GetTorrents(ctx ...context.Context) (Torrents, error) + func (c *Client) GetTorrentsByIDs(ctx context.Context, ids []int, fields ...string) (Torrents, error) + func (c *Client) PortTest(ctx context.Context) (bool, error) + func (c *Client) QueueMoveBottom(ctx context.Context, ids ...int) error + func (c *Client) QueueMoveDown(ctx context.Context, ids ...int) error + func (c *Client) QueueMoveTop(ctx context.Context, ids ...int) error + func (c *Client) QueueMoveUp(ctx context.Context, ids ...int) error + func (c *Client) ReannounceTorrents(ctx context.Context, ids ...int) error + func (c *Client) RemoveTorrents(ctx context.Context, deleteLocalData bool, ids ...int) error + func (c *Client) RenameTorrentPath(ctx context.Context, id int, path, newName string) (*RenameResult, error) + func (c *Client) SetAltSpeedEnabled(ctx context.Context, enabled bool) error + func (c *Client) SetDownloadDir(ctx context.Context, dir string) error + func (c *Client) SetSession(ctx context.Context, opt SessionSetOptions) error + func (c *Client) SetSort(st Sorting) + func (c *Client) SetSpeedLimit(ctx context.Context, limitType SpeedLimitType, limitKB uint) error + func (c *Client) SetTorrent(ctx context.Context, ids []int, opt TorrentSetOptions) error + func (c *Client) SetTorrentLocation(ctx context.Context, location string, move bool, ids ...int) error + func (c *Client) StartAll(ctx ...context.Context) error + func (c *Client) StartTorrent(id int) (string, error) + func (c *Client) StartTorrents(ctx context.Context, ids ...int) error + func (c *Client) StartTorrentsNow(ctx context.Context, ids ...int) error + func (c *Client) StopAll(ctx ...context.Context) error + func (c *Client) StopTorrent(id int) (string, error) + func (c *Client) StopTorrents(ctx context.Context, ids ...int) error + func (c *Client) UpdateBlocklist(ctx context.Context) (int, error) + func (c *Client) VerifyAll(ctx ...context.Context) error + func (c *Client) VerifyTorrent(id int) (string, error) + func (c *Client) VerifyTorrents(ctx context.Context, ids ...int) error + func (c *Client) Version() string + type Command struct + Arguments arguments + Method string + Result string + func NewAddCmd() *Command + func NewAddCmdByFile(file string) (*Command, error) + func NewAddCmdByFilename(filename string) *Command + func NewAddCmdByURL(url string) *Command + func NewGetTorrentsCmd() *Command + func NewSessionSetCommand() *Command + func NewSpeedLimitCommand(limitType SpeedLimitType, limit uint) *Command + func (cmd *Command) SetDownloadDir(dir string) + type File struct + BytesCompleted int64 + Length int64 + Name string + type FileStat struct + BytesCompleted int64 + Priority int + Wanted bool + type Option func(*Client) + func WithCustomHeader(key, value string) Option + func WithHTTPClient(httpClient *http.Client) Option + func WithTimeout(timeout time.Duration) Option + type Peer struct + Address string + ClientIsChoked bool + ClientIsInterested bool + ClientName string + FlagStr string + IsDownloadingFrom bool + IsEncrypted bool + IsIncoming bool + IsUploadingTo bool + PeerIsChoked bool + PeerIsInterested bool + Port int + Progress float64 + RateToClient uint64 + RateToPeer uint64 + type RenameResult struct + ID int + Name string + Path string + type Session struct + AltSpeedDown int64 + AltSpeedEnabled bool + AltSpeedTimeBegin int + AltSpeedTimeDay int + AltSpeedTimeEnabled bool + AltSpeedTimeEnd int + AltSpeedUp int64 + BlocklistEnabled bool + BlocklistSize int + BlocklistURL string + CacheSizeMB int + ConfigDir string + DHTEnabled bool + DefaultTrackers string + DownloadDir string + DownloadDirFreeSpace int64 + DownloadQueueEnabled bool + DownloadQueueSize int + Encryption string + IdleSeedingLimit int + IdleSeedingLimitEnabled bool + IncompleteDir string + IncompleteDirEnabled bool + LPDEnabled bool + PeerLimitGlobal int + PeerLimitPerTorrent int + PeerPort int + PeerPortRandomOnStart bool + PexEnabled bool + PortForwardingEnabled bool + QueueStalledEnabled bool + QueueStalledMinutes int + RPCVersion int + RPCVersionMinimum int + RPCVersionSemver string + RenamePartialFiles bool + ScriptTorrentAddedEnabled bool + ScriptTorrentAddedFilename string + ScriptTorrentDoneEnabled bool + ScriptTorrentDoneFilename string + SeedQueueEnabled bool + SeedQueueSize int + SeedRatioLimit float64 + SeedRatioLimited bool + SessionID string + SpeedLimitDown int64 + SpeedLimitDownEnabled bool + SpeedLimitUp int64 + SpeedLimitUpEnabled bool + StartAddedTorrents bool + TrashOriginalTorrentFiles bool + UTPEnabled bool + Version string + type SessionSetOptions struct + AltSpeedDown *int64 + AltSpeedEnabled *bool + AltSpeedTimeBegin *int + AltSpeedTimeDay *int + AltSpeedTimeEnabled *bool + AltSpeedTimeEnd *int + AltSpeedUp *int64 + BlocklistEnabled *bool + BlocklistURL *string + CacheSizeMB *int + DHTEnabled *bool + DefaultTrackers *string + DownloadDir *string + DownloadQueueEnabled *bool + DownloadQueueSize *int + Encryption *string + IdleSeedingLimit *int + IdleSeedingLimitEnabled *bool + IncompleteDir *string + IncompleteDirEnabled *bool + LPDEnabled *bool + PeerLimitGlobal *int + PeerLimitPerTorrent *int + PeerPort *int + PeerPortRandomOnStart *bool + PexEnabled *bool + PortForwardingEnabled *bool + QueueStalledEnabled *bool + QueueStalledMinutes *int + RenamePartialFiles *bool + ScriptTorrentAddedEnabled *bool + ScriptTorrentAddedFilename *string + ScriptTorrentDoneEnabled *bool + ScriptTorrentDoneFilename *string + SeedQueueEnabled *bool + SeedQueueSize *int + SeedRatioLimit *float64 + SeedRatioLimited *bool + SpeedLimitDown *int64 + SpeedLimitDownEnabled *bool + SpeedLimitUp *int64 + SpeedLimitUpEnabled *bool + StartAddedTorrents *bool + TrashOriginalTorrentFiles *bool + UTPEnabled *bool + type Sorting int + const SortAge + const SortDownSpeed + const SortDownloaded + const SortID + const SortName + const SortProgress + const SortRatio + const SortRevAge + const SortRevDownSpeed + const SortRevDownloaded + const SortRevID + const SortRevName + const SortRevProgress + const SortRevRatio + const SortRevSize + const SortRevUpSpeed + const SortRevUploaded + const SortSize + const SortUpSpeed + const SortUploaded + type SpeedLimitType string + const DownloadLimitType + const UploadLimitType + type Stats struct + ActiveTorrentCount int + CumulativeStats cumulativeStats + CurrentStats currentStats + DownloadSpeed uint64 + PausedTorrentCount int + TorrentCount int + UploadSpeed uint64 + func (s *Stats) CumulativeActiveTime() string + func (s *Stats) CurrentActiveTime() string + type Torrent struct + ActivityDate int64 + AddedDate int64 + BandwidthPriority int + Comment string + CorruptEver uint64 + Creator string + DateCreated int64 + DesiredAvailable uint64 + DoneDate int64 + DownloadDir string + DownloadLimit int + DownloadLimited bool + DownloadedEver uint64 + EditDate int64 + Error int + ErrorString string + Eta time.Duration + EtaIdle time.Duration + FileCount int + FileStats []FileStat + Files []File + HashString string + HaveUnchecked uint64 + HaveValid uint64 + HonorsSessionLimits bool + ID int + IsFinished bool + IsPrivate bool + IsStalled bool + Labels []string + LeftUntilDone uint64 + ManualAnnounceTime int64 + MaxConnectedPeers int + MetadataPercentComplete float64 + Name string + PeerLimit int + Peers []Peer + PeersConnected int + PeersFrom map[string]int + PeersGettingFromUs int + PeersSendingToUs int + PercentComplete float64 + PercentDone float64 + PieceCount int + PieceSize int64 + Priorities []int + QueuePosition int + RateDownload uint64 + RateUpload uint64 + RecheckProgress float64 + SecondsDownloading int + SecondsSeeding int + SeedIdleLimit int + SeedIdleMode int + SeedRatioLimit float64 + SeedRatioMode int + SizeWhenDone uint64 + StartDate int64 + Status int + TorrentFile string + TotalSize uint64 + Trackers []Tracker + UploadLimit int + UploadLimited bool + UploadRatio float64 + UploadedEver uint64 + Wanted []int + Webseeds []string + WebseedsSendingToUs int + func (t *Torrent) ETA() string + func (t *Torrent) GetTrackers() string + func (t *Torrent) Have() uint64 + func (t *Torrent) Ratio() string + func (t *Torrent) TorrentStatus() string + type TorrentAdded struct + HashString string + ID int + Name string + type TorrentSetOptions struct + BandwidthPriority *int + DownloadLimit *int + DownloadLimited *bool + FilesUnwanted []int + FilesWanted []int + Group *string + HonorsSessionLimits *bool + Labels []string + Location *string + PeerLimit *int + PriorityHigh []int + PriorityLow []int + PriorityNormal []int + QueuePosition *int + SeedIdleLimit *int + SeedIdleMode *int + SeedRatioLimit *float64 + SeedRatioMode *int + SequentialDownload *bool + SequentialDownloadFromPiece *int + TrackerList *string + UploadLimit *int + UploadLimited *bool + type Torrents []*Torrent + func (t Torrents) GetIDs() []int + func (t Torrents) SortAge(reverse bool) + func (t Torrents) SortDownSpeed(reverse bool) + func (t Torrents) SortDownloaded(reverse bool) + func (t Torrents) SortID(reverse bool) + func (t Torrents) SortName(reverse bool) + func (t Torrents) SortProgress(reverse bool) + func (t Torrents) SortRatio(reverse bool) + func (t Torrents) SortSize(reverse bool) + func (t Torrents) SortUpSpeed(reverse bool) + func (t Torrents) SortUploaded(reverse bool) + type Tracker struct + Announce string + ID int + Scrape string + Tier int + type TransmissionClient = Client