tor

package
v0.0.0-...-1627eae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2015 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Overview

Package tor supplies helper functions to start a tor binary as a slave process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Config *Config
	// contains filtered or unexported fields
}

Cmd represents an tor executable to be run as a slave process.

func NewCmd

func NewCmd(config *Config) (*Cmd, error)

NewCmd returns a Cmd to run a tor process using the configuration values in config.

func (*Cmd) KillUnlessExited

func (c *Cmd) KillUnlessExited()

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) Wait

func (c *Cmd) Wait() error

type Config

type Config struct {
	// Path is the path to a tor executable to be run. If path is the empty string,
	// $PATH is used to search for a tor executable.
	Path string
	// Timeout is the maximum amount of time we will wait for
	// a connect to the Tor network to complete.
	Timeout time.Duration
	// Options is a map of configuration options to values to be used
	// as command line arguments or in a torrc configuration file.
	Options map[string]string
	// contains filtered or unexported fields
}

A Config struct is used to configure a to be executed Tor process.

func NewConfig

func NewConfig() *Config

func (*Config) Err

func (c *Config) Err() error

Err reports the first error that was encountered during the preceding calls to Set() and clears the saved error value to nil.

func (*Config) Set

func (c *Config) Set(option string, value interface{})

func (Config) ToCmdLineFormat

func (c Config) ToCmdLineFormat() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL