Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CfgEntryNodes defines the config flag of the entry nodes. CfgEntryNodes = "autopeering.entryNodes" // CfgNetworkVersion defines the config flag of the network version. CfgNetworkVersion = "autopeering.networkVersion" )
View Source
const PluginName = "Autopeering"
PluginName is the name of the autopeering plugin.
View Source
const (
ProtocolVersion = 0 // update on protocol changes
)
autopeering constants
Variables ¶
This section is empty.
Functions ¶
func BindAddress ¶ added in v0.2.0
func BindAddress() string
BindAddress returns the string form of the autopeering bind address.
func NetworkVersion ¶ added in v0.2.0
func NetworkVersion() uint32
NetworkVersion returns the network version of the autopeering.
func StartSelection ¶ added in v0.2.0
func StartSelection()
StartSelection starts the neighbor selection process. It blocks until the peer discovery has been started. Multiple calls of StartSelection are ignored.
Types ¶
type NetConnMetric ¶ added in v0.2.0
NetConnMetric is a wrapper of a UDPConn that keeps track of RX and TX bytes.
var ( // ErrParsingMasterNode is returned for an invalid master node. ErrParsingMasterNode = errors.New("cannot parse master node") // Conn contains the network connection. Conn *NetConnMetric )
func (*NetConnMetric) RXBytes ¶ added in v0.2.0
func (nc *NetConnMetric) RXBytes() uint64
RXBytes returns the RX bytes.
func (*NetConnMetric) ReadFromUDP ¶ added in v0.2.0
ReadFromUDP acts like ReadFrom but returns a UDPAddr.
func (*NetConnMetric) TXBytes ¶ added in v0.2.0
func (nc *NetConnMetric) TXBytes() uint64
TXBytes returns the TX bytes.
func (*NetConnMetric) WriteToUDP ¶ added in v0.2.0
WriteToUDP acts like WriteTo but takes a UDPAddr.
Click to show internal directories.
Click to hide internal directories.