2
0
mirror of synced 2025-02-24 14:48:27 +00:00
torrent/config.go
Matt Joiner 1e919dd6b1 Rework storage interfaces to make them simpler to implement
This allows lots of behaviour to be baked into the new Client, Torrent and Piece wrappers, rather than duplicating (badly) them in all the backend implementations.
2016-09-02 15:10:57 +10:00

46 lines
1.7 KiB
Go

package torrent
import (
"github.com/anacrolix/torrent/dht"
"github.com/anacrolix/torrent/iplist"
"github.com/anacrolix/torrent/storage"
)
// Override Client defaults.
type Config struct {
// Store torrent file data in this directory unless TorrentDataOpener is
// specified.
DataDir string `long:"data-dir" description:"directory to store downloaded torrent data"`
// The address to listen for new uTP and TCP bittorrent protocol
// connections. DHT shares a UDP socket with uTP unless configured
// otherwise.
ListenAddr string `long:"listen-addr" value-name:"HOST:PORT"`
// Don't announce to trackers. This only leaves DHT to discover peers.
DisableTrackers bool `long:"disable-trackers"`
DisablePEX bool `long:"disable-pex"`
// Don't create a DHT.
NoDHT bool `long:"disable-dht"`
// Overrides the default DHT configuration.
DHTConfig dht.ServerConfig
// Don't ever send chunks to peers.
NoUpload bool `long:"no-upload"`
// Upload even after there's nothing in it for us. By default uploading is
// not altruistic.
Seed bool `long:"seed"`
// User-provided Client peer ID. If not present, one is generated automatically.
PeerID string
// For the bittorrent protocol.
DisableUTP bool
// For the bittorrent protocol.
DisableTCP bool `long:"disable-tcp"`
// Called to instantiate storage for each added torrent. Provided backends
// are in $REPO/data. If not set, the "file" implementation is used.
DefaultStorage storage.ClientImpl
DisableEncryption bool `long:"disable-encryption"`
IPBlocklist iplist.Ranger
DisableIPv6 bool `long:"disable-ipv6"`
// Perform logging and any other behaviour that will help debug.
Debug bool `help:"enable debug logging"`
}