# README
mainline-dht-common
This is a collection of utility functions used by the different Mainline DHT projects.
It is intended for use as a library across the various MLDHT projects, i.e.
Installation
The library can be installed using
go get github.com/wiberlin/mainline-dht-common
# Functions
AskYesNo asks the user to enter "y" or "n".
No description provided by the author
CreateDirIfNotExists creates the directory described in path if it does not exist yet.
DetermineIPVersion determines whether the given address is v4, v6, or invalid.
IsIPAddressLocal determines whether an IP address is local.
IsNullSlice checks if the bytes of given slice are all null.
MonitorReportToFile writes the report to the file in path.
NodeInfoToID extracts each ID from an arry of krpc.NodeInfo and returns the krpc.IDs.
NodeinfoToUdpAddr converts a krpc.NodeInfo to a net.UDPAddr.
ParseAddrString parses an IP:port address into anacrolix/dht krpc.NodeInfo.
ReadBootstrapListFromFile parses a file containing bootstrap peers.
TargetIsInZone returns true is targetID has zone many bits in common with sourceID.
UDPToNodeAddr converts the net.UDPAddr to a krpc.NodeAddr.
# Constants
Enum describing possible types of IP addresses.
Enum describing possible types of IP addresses.
Enum describing possible types of IP addresses.
# Structs
CrawledNode stores everything we know about a node we have contacted.
CrawledNodeJSON encodes a node found by the crawler as a JSON string.
CrawlOutput summarises the crawl, i.e.
CrawledOutputJSON is a collection of CrawledNodeJSON along with a timestamp.
CrawlResult is a container struct for crawl results..
KRPCNilResponseError signals that the KRPC Query returned an error.
MonitoredNodeJSON holds a DHT Node described by its UDP address, its connectivity status and IP Version encoded as JSON strings.
MonitorOutputJSON is a collection of MonitoredNodeJSON.
NodeKnows stores the collected addresses for a given ID.
ObservedNode contains all the information about a single node during observation.
Output is an object that contains the results of the monitoring period, i.e.