Documentation ¶
Overview ¶
Package torconfig manages tor configuration options and serialization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTorrcMissingArguments = errors.New("expected arguments in torrc config line")
ErrTorrcMissingArguments occurs if the parser finds a config line without arguments. Expect to see a keyword followed by one or more arguments.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Nickname string IP net.IP // Relay public IP ORBindIP net.IP // OR bind address ORPort uint16 Platform string Contact string BandwidthAverage int BandwidthBurst int Keys *Keys Data Data }
Config encapsulates configuration options for a Tor relay.
func ParseTorrc ¶
ParseTorrc parses Config from the given reader (in torrc format).
func ParseTorrcFile ¶
ParseTorrcFile parses config from the given torrc file.
func (Config) ORBindAddr ¶
ORBindAddr returns the address the relay should bind to.
type Data ¶
type Data interface { Keys() (*Keys, error) SetKeys(*Keys) error SetServerDescriptor(*tordir.ServerDescriptor) error }
Data is an interface to router data storage.
func NewDataDirectory ¶
NewDataDirectory constructs a new data directory at dir.
type Keys ¶
type Keys struct { Identity *rsa.PrivateKey Onion *rsa.PrivateKey Ntor *torcrypto.Curve25519KeyPair }
func GenerateKeys ¶
func LoadKeysFromDirectory ¶
func (*Keys) SaveToDirectory ¶
type Platform ¶
Platform encapsulates a standard specification of the platform a router is using. This specifies which software it is running, the version of that software and the host OS.
func NewOfficialPlatform ¶
NewOfficialPlatform constructs a new Platform object for official Tor of the given version.
func NewPlatform ¶
NewPlatform constructs a new Platform specification.
func NewPlatformHostOS ¶
NewPlatformHostOS constructs a new Platform object with the operating system field set to the current host OS.