]> Sergey Matveev's repositories - btrtrc.git/blob - config.go
Merge pull request #188 from boramalper/KnownSwarm
[btrtrc.git] / config.go
1 package torrent
2
3 import (
4         "github.com/anacrolix/dht"
5         "golang.org/x/time/rate"
6
7         "github.com/anacrolix/torrent/iplist"
8         "github.com/anacrolix/torrent/storage"
9 )
10
11 // Override Client defaults.
12 type Config struct {
13         // Store torrent file data in this directory unless TorrentDataOpener is
14         // specified.
15         DataDir string `long:"data-dir" description:"directory to store downloaded torrent data"`
16         // The address to listen for new uTP and TCP bittorrent protocol
17         // connections. DHT shares a UDP socket with uTP unless configured
18         // otherwise.
19         ListenAddr string `long:"listen-addr" value-name:"HOST:PORT"`
20         // Don't announce to trackers. This only leaves DHT to discover peers.
21         DisableTrackers bool `long:"disable-trackers"`
22         DisablePEX      bool `long:"disable-pex"`
23         // Don't create a DHT.
24         NoDHT bool `long:"disable-dht"`
25         // Overrides the default DHT configuration.
26         DHTConfig dht.ServerConfig
27
28         // Never send chunks to peers.
29         NoUpload bool `long:"no-upload"`
30         // Upload even after there's nothing in it for us. By default uploading is
31         // not altruistic, we'll upload slightly more than we download from each
32         // peer.
33         Seed bool `long:"seed"`
34         // Events are data bytes sent in pieces. The burst must be large enough to
35         // fit a whole chunk.
36         UploadRateLimiter *rate.Limiter
37         // The events are bytes read from connections. The burst must be bigger
38         // than the largest Read performed on a Conn minus one. This is likely to
39         // be the larger of the main read loop buffer (~4096), and the requested
40         // chunk size (~16KiB).
41         DownloadRateLimiter *rate.Limiter
42
43         // User-provided Client peer ID. If not present, one is generated automatically.
44         PeerID string
45         // For the bittorrent protocol.
46         DisableUTP bool
47         // For the bittorrent protocol.
48         DisableTCP bool `long:"disable-tcp"`
49         // Called to instantiate storage for each added torrent. Builtin backends
50         // are in the storage package. If not set, the "file" implementation is
51         // used.
52         DefaultStorage storage.ClientImpl
53
54         EncryptionPolicy
55
56         IPBlocklist iplist.Ranger
57         DisableIPv6 bool `long:"disable-ipv6"`
58         // Perform logging and any other behaviour that will help debug.
59         Debug bool `help:"enable debug logging"`
60 }
61
62 type EncryptionPolicy struct {
63         DisableEncryption  bool
64         ForceEncryption    bool // Don't allow unobfuscated connections.
65         PreferNoEncryption bool
66 }