Documentation ¶
Overview ¶
Package config implements the configuration for a BitTorrent tracker
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Addr: ":6881", Tracker: DriverConfig{ Name: "memory", }, Backend: DriverConfig{ Name: "noop", }, PrivateEnabled: false, FreeleechEnabled: false, PurgeInactiveTorrents: true, Announce: Duration{30 * time.Minute}, MinAnnounce: Duration{15 * time.Minute}, RequestTimeout: Duration{10 * time.Second}, HttpReadTimeout: Duration{10 * time.Second}, HttpWriteTimeout: Duration{10 * time.Second}, NumWantFallback: 50, StatsConfig: StatsConfig{ BufferSize: 0, IncludeMem: true, VerboseMem: false, MemUpdateInterval: Duration{5 * time.Second}, }, NetConfig: NetConfig{ AllowIPSpoofing: true, DualStackedPeers: true, RespectAF: false, }, ShardConfig: ShardConfig{ TorrentMapShards: 1, }, ClientWhitelistEnabled: false, }
DefaultConfig is a configuration that can be used as a fallback value.
View Source
var ErrMissingRequiredParam = errors.New("A parameter that was required by a driver is not present")
ErrMissingRequiredParam is used by drivers to indicate that an entry required to be within the DriverConfig.Params map is not present.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string `json:"addr"` Tracker DriverConfig `json:"tracker"` Backend DriverConfig `json:"backend"` PrivateEnabled bool `json:"private_enabled"` FreeleechEnabled bool `json:"freeleech_enabled"` PurgeInactiveTorrents bool `json:"purge_inactive_torrents"` Announce Duration `json:"announce"` MinAnnounce Duration `json:"min_announce"` RequestTimeout Duration `json:"request_timeout"` HttpReadTimeout Duration `json:"http_read_timeout"` HttpWriteTimeout Duration `json:"http_write_timeout"` HttpListenLimit int `json:"http_listen_limit"` NumWantFallback int `json:"default_num_want"` ClientWhitelistEnabled bool `json:"client_whitelist_enabled"` ClientWhitelist []string `json:"client_whitelist,omitempty"` StatsConfig NetConfig ShardConfig }
Config is a configuration for a Server.
type DriverConfig ¶
type DriverConfig struct { Name string `json:"driver"` Params map[string]string `json:"params,omitempty"` }
DriverConfig is the configuration used to connect to a tracker.Driver or a backend.Driver.
type Duration ¶
Duration wraps a time.Duration and adds JSON marshalling.
func (*Duration) MarshalJSON ¶
MarshalJSON transforms a duration into JSON.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON transform JSON into a Duration.
type NetConfig ¶
type NetConfig struct { AllowIPSpoofing bool `json:"allow_ip_spoofing"` DualStackedPeers bool `json:"dual_stacked_peers"` RealIPHeader string `json:"real_ip_header"` RespectAF bool `json:"respect_af"` SubnetConfig }
NetConfig is the configuration used to tune networking behaviour.
type ShardConfig ¶
type ShardConfig struct {
TorrentMapShards int `json:"torrent_map_shards"`
}
type StatsConfig ¶
type SubnetConfig ¶
Click to show internal directories.
Click to hide internal directories.