Documentation ¶
Overview ¶
Package frontend defines interface which should satisfy every network frontend
Index ¶
Constants ¶
const DefaultListenAddress = ":6969"
DefaultListenAddress is the default net listen address if nothing else provided
Variables ¶
This section is empty.
Functions ¶
func CloseGroup ¶ added in v0.0.4
CloseGroup simultaneously calls Close for each non-nil array element and combines non-nil errors into one
func RegisterBuilder ¶ added in v0.0.3
RegisterBuilder makes a Builder available by the provided name.
If called twice with the same name, the name is blank, or if the provided Builder is nil, this function panics.
Types ¶
type Builder ¶ added in v0.0.3
Builder is the function used to initialize a new Frontend with provided configuration.
type Frontend ¶ added in v0.0.3
Frontend dummy interface for bittorrent frontends
func NewFrontends ¶ added in v0.0.3
func NewFrontends(configs []conf.NamedMapConfig, logic *middleware.Logic) (fs []Frontend, err error)
NewFrontends is a utility function for initializing Frontend-s in bulk. Returns nil hook and error if frontend with name provided in config does not exists.
type ListenOptions ¶ added in v0.0.3
type ListenOptions struct { Addr string ReusePort bool `cfg:"reuse_port"` Workers uint EnableRequestTiming bool `cfg:"enable_request_timing"` }
ListenOptions is the base configuration which may be used in net listeners
func (ListenOptions) ListenTCP ¶ added in v0.0.3
func (lo ListenOptions) ListenTCP() (conn *net.TCPListener, err error)
ListenTCP listens at the given TCP Addr with SO_REUSEPORT and SO_REUSEADDR options enabled if ReusePort set to true
func (ListenOptions) ListenUDP ¶ added in v0.0.3
func (lo ListenOptions) ListenUDP() (conn *net.UDPConn, err error)
ListenUDP listens at the given UDP Addr with SO_REUSEPORT and SO_REUSEADDR options enabled if ReusePort set to true
func (ListenOptions) Validate ¶ added in v0.0.3
func (lo ListenOptions) Validate(logger *log.Logger) (validOptions ListenOptions)
Validate checks if listen address provided and sets default timeout options if needed
type ParseOptions ¶
type ParseOptions struct { AllowIPSpoofing bool `cfg:"allow_ip_spoofing"` FilterPrivateIPs bool `cfg:"filter_private_ips"` MaxNumWant uint32 `cfg:"max_numwant"` DefaultNumWant uint32 `cfg:"default_numwant"` MaxScrapeInfoHashes uint32 `cfg:"max_scrape_infohashes"` }
ParseOptions is the configuration used to parse an Announce Request.
If AllowIPSpoofing is true, IPs provided via params will be used.
func (ParseOptions) Validate ¶
func (op ParseOptions) Validate(logger *log.Logger) ParseOptions
Validate sanity checks values set in a config and returns a new config with default values replacing anything that is invalid.
Directories ¶
Path | Synopsis |
---|---|
Package http implements a BitTorrent frontend via the HTTP protocol as described in BEP 3 and BEP 23.
|
Package http implements a BitTorrent frontend via the HTTP protocol as described in BEP 3 and BEP 23. |
Package udp implements a BitTorrent tracker via the UDP protocol as described in BEP 15.
|
Package udp implements a BitTorrent tracker via the UDP protocol as described in BEP 15. |