serverutils

package
v0.0.7-dev Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BTCDDial

func BTCDDial(addr net.Addr) (net.Conn, error)

BTCDDial connects to the address on the named network using the appropriate dial function depending on the address and configuration options. For example, .onion addresses will be dialed using the onion specific proxy if one was specified, but will otherwise use the normal dial function (which could itself use a proxy or not).

func BTCDLookup

func BTCDLookup(host string) ([]net.IP, error)

BTCDLookup resolves the IP of the given host using the correct DNS lookup function depending on the configuration options. For example, addresses will be resolved using tor when the --proxy flag was specified unless --noonion was also specified in which case the normal system DNS resolver will be used.

Any attempt to resolve a tor address (.onion) will return an error since they are not intended to be resolved outside of the tor proxy.

func GenCertPair

func GenCertPair(certFile, keyFile string) error

GenCertPair generates a key/cert pair to the paths provided.

Types

type NAT

type NAT interface {
	// Get the external address from outside the NAT.
	GetExternalAddress() (addr net.IP, err error)
	// Add a port mapping for protocol ("udp" or "tcp") from external port to
	// internal port with description lasting for timeout.
	AddPortMapping(protocol string, externalPort, internalPort int, description string, timeout int) (mappedExternalPort int, err error)
	// Remove a previously added port mapping from external port to
	// internal port.
	DeletePortMapping(protocol string, externalPort, internalPort int) (err error)
}

NAT is an interface representing a NAT traversal options for example UPNP or NAT-PMP. It provides methods to query and manipulate this traversal to allow access to services.

func Discover

func Discover() (nat NAT, err error)

Discover searches the local network for a UPnP router returning a NAT for the network if so, nil if not.

type Peer

type Peer struct {
	*peer.Peer

	// The following variables must only be used atomically
	FeeFilter int64

	DynamicBanScore connmgr.DynamicBanScore

	DisableRelayTx bool
	// contains filtered or unexported fields
}

Peer extends the peer to maintain state shared by the server and the blockmanager.

Jump to

Keyboard shortcuts

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