torrent/config.go

46 lines
1.7 KiB
Go
Raw Normal View History

2014-08-21 08:07:06 +00:00
package torrent
import (
"github.com/anacrolix/torrent/dht"
"github.com/anacrolix/torrent/iplist"
2016-03-28 09:38:30 +00:00
"github.com/anacrolix/torrent/storage"
)
2015-03-08 06:28:14 +00:00
// Override Client defaults.
2014-08-21 08:07:06 +00:00
type Config struct {
2015-03-08 06:28:14 +00:00
// Store torrent file data in this directory unless TorrentDataOpener is
// specified.
DataDir string `long:"data-dir" description:"directory to store downloaded torrent data"`
2015-03-08 06:28:14 +00:00
// 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"`
2015-03-08 06:28:14 +00:00
// Don't announce to trackers. This only leaves DHT to discover peers.
DisableTrackers bool `long:"disable-trackers"`
DisablePEX bool `long:"disable-pex"`
2015-03-08 06:28:14 +00:00
// Don't create a DHT.
NoDHT bool `long:"disable-dht"`
2015-03-08 06:28:14 +00:00
// Overrides the default DHT configuration.
2016-01-16 13:12:53 +00:00
DHTConfig dht.ServerConfig
2015-05-14 22:39:53 +00:00
// Don't ever send chunks to peers.
NoUpload bool `long:"no-upload"`
2015-05-14 22:39:53 +00:00
// Upload even after there's nothing in it for us. By default uploading is
// not altruistic.
Seed bool `long:"seed"`
2015-03-08 06:28:14 +00:00
// 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"`
2015-03-08 06:28:14 +00:00
// 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
2015-04-20 07:30:22 +00:00
DisableEncryption bool `long:"disable-encryption"`
2016-04-04 06:23:30 +00:00
IPBlocklist iplist.Ranger
2015-11-05 12:21:39 +00:00
DisableIPv6 bool `long:"disable-ipv6"`
// Perform logging and any other behaviour that will help debug.
2015-11-05 12:21:39 +00:00
Debug bool `help:"enable debug logging"`
2014-08-21 08:07:06 +00:00
}