Versions in this module Expand all Collapse all v1 v1.0.3 Aug 29, 2021 Changes in this version type Session + func NewSessionWithDB(cfg Config, db *bbolt.DB) (*Session, error) v1.0.2 Aug 28, 2021 v1.0.1 Aug 28, 2021 Changes in this version type Config + AllocatorReservedSize uint64 v1.0.0 Aug 28, 2021 Changes in this version + var DefaultConfig = Config + var Version = "0.0.0" + func DisableLogging() + type AddTorrentOptions struct + ID string + StopAfterDownload bool + Stopped bool + type AnnounceError struct + func (e *AnnounceError) Error() string + func (e *AnnounceError) Unknown() bool + func (e *AnnounceError) Unwrap() error + type Config struct + AllowedFastSet int + BlocklistEnabledForIncomingConnections bool + BlocklistEnabledForOutgoingConnections bool + BlocklistEnabledForTrackers bool + BlocklistMaxResponseSize int64 + BlocklistURL string + BlocklistUpdateInterval time.Duration + BlocklistUpdateTimeout time.Duration + DHTAnnounceInterval time.Duration + DHTBootstrapNodes []string + DHTEnabled bool + DHTHost string + DHTMinAnnounceInterval time.Duration + DHTPort uint16 + DNSResolveTimeout time.Duration + DataDir string + DataDirIncludesTorrentID bool + Database string + DefaultRequestsOut int + DisableOutgoingEncryption bool + EndgameMaxDuplicateDownloads int + ForceIncomingEncryption bool + ForceOutgoingEncryption bool + MaxMetadataSize uint + MaxOpenFiles uint64 + MaxPeerAccept int + MaxPeerAddresses int + MaxPeerDial int + MaxPieces uint32 + MaxRequestsIn int + MaxRequestsOut int + MaxTorrentSize uint + OnCompleteCmd []string + OptimisticUnchokedPeers int + PEXEnabled bool + ParallelMetadataDownloads int + ParallelReads uint + ParallelWrites uint + PeerConnectTimeout time.Duration + PeerHandshakeTimeout time.Duration + PieceReadTimeout time.Duration + PortBegin uint16 + PortEnd uint16 + PrivateExtensionHandshakeClientVersion string + PrivatePeerIDPrefix string + RPCEnabled bool + RPCHost string + RPCPort int + RPCShutdownTimeout time.Duration + ReadCacheBlockSize int64 + ReadCacheSize int64 + ReadCacheTTL time.Duration + RequestTimeout time.Duration + ResumeOnStartup bool + ResumeWriteInterval time.Duration + SpeedLimitDownload int64 + SpeedLimitUpload int64 + TorrentAddHTTPTimeout time.Duration + TrackerHTTPMaxResponseSize uint + TrackerHTTPPrivateUserAgent string + TrackerHTTPTimeout time.Duration + TrackerHTTPVerifyTLS bool + TrackerMinAnnounceInterval time.Duration + TrackerNumWant int + TrackerStopTimeout time.Duration + UnchokedPeers int + WebseedDialTimeout time.Duration + WebseedMaxDownloads int + WebseedMaxSources int + WebseedResponseBodyReadTimeout time.Duration + WebseedResponseHeaderTimeout time.Duration + WebseedRetryInterval time.Duration + WebseedTLSHandshakeTimeout time.Duration + WebseedVerifyTLS bool + WriteCacheSize int64 + type InfoHash [20]byte + func (h InfoHash) String() string + type InputError struct + func (e *InputError) Error() string + func (e *InputError) Unwrap() error + type Peer struct + Addr net.Addr + Client string + ClientChoking bool + ClientInterested bool + ConnectedAt time.Time + DownloadSpeed int + Downloading bool + EncryptedHandshake bool + EncryptedStream bool + ID [20]byte + OptimisticUnchoked bool + PeerChoking bool + PeerInterested bool + Snubbed bool + Source PeerSource + UploadSpeed int + type PeerSource int + const SourceDHT + const SourceIncoming + const SourceManual + const SourcePEX + const SourceTracker + type Session struct + func NewSession(cfg Config) (*Session, error) + func (s *Session) AddTorrent(r io.Reader, opt *AddTorrentOptions) (*Torrent, error) + func (s *Session) AddURI(uri string, opt *AddTorrentOptions) (*Torrent, error) + func (s *Session) CleanDatabase() error + func (s *Session) Close() error + func (s *Session) CompactDatabase(output string) error + func (s *Session) GetTorrent(id string) *Torrent + func (s *Session) ListTorrents() []*Torrent + func (s *Session) RemoveTorrent(id string) error + func (s *Session) StartAll() error + func (s *Session) Stats() SessionStats + func (s *Session) StopAll() error + type SessionStats struct + BlockListRecency time.Duration + BlockListRules int + Peers int + PortsAvailable int + ReadCacheObjects int + ReadCacheSize int64 + ReadCacheUtilization int + ReadsActive int + ReadsPending int + ReadsPerSecond int + SpeedDownload int + SpeedRead int + SpeedUpload int + SpeedWrite int + Torrents int + Uptime time.Duration + WriteCacheObjects int + WriteCachePendingKeys int + WriteCacheSize int64 + WritesActive int + WritesPending int + WritesPerSecond int + type Stats struct + Addresses struct{ ... } + Bytes struct{ ... } + Downloads struct{ ... } + ETA *time.Duration + Error error + Handshakes struct{ ... } + InfoHash InfoHash + MetadataDownloads struct{ ... } + Name string + Peers struct{ ... } + PieceLength uint32 + Pieces struct{ ... } + Port int + Private bool + SeededFor time.Duration + Speed struct{ ... } + Status Status + type Status int + const Allocating + const Downloading + const DownloadingMetadata + const Seeding + const Stopped + const Stopping + const Verifying + func (s Status) String() string + type Torrent struct + func (t *Torrent) AddPeer(addr string) error + func (t *Torrent) AddTracker(uri string) error + func (t *Torrent) AddedAt() time.Time + func (t *Torrent) Announce() + func (t *Torrent) ID() string + func (t *Torrent) InfoHash() InfoHash + func (t *Torrent) Magnet() (string, error) + func (t *Torrent) Move(target string) error + func (t *Torrent) Name() string + func (t *Torrent) NotifyComplete() <-chan struct{} + func (t *Torrent) NotifyStop() <-chan error + func (t *Torrent) Peers() []Peer + func (t *Torrent) Port() int + func (t *Torrent) Start() error + func (t *Torrent) Stats() Stats + func (t *Torrent) Stop() error + func (t *Torrent) Torrent() ([]byte, error) + func (t *Torrent) Trackers() []Tracker + func (t *Torrent) Verify() error + func (t *Torrent) Webseeds() []Webseed + type Tracker struct + Error *AnnounceError + LastAnnounce time.Time + Leechers int + NextAnnounce time.Time + Seeders int + Status TrackerStatus + URL string + Warning string + type TrackerStatus int + const Contacting + const NotContactedYet + const NotWorking + const Working + type Webseed struct + DownloadSpeed int + Error error + URL string