Documentation ¶
Index ¶
- Variables
- func AddHost(h *HostService)
- func AddHosts(hs []*HostService)
- func AnnounceAll()
- func AnnounceSelf(ip, port string)
- func AppendHosts(hs []*HostService)
- func ArpScan()
- func CidrHosts(cidr string) ([]string, error)
- func FormatHttpIpPort(ip, port string) string
- func FormatHttpIpPort_i(ip string, port uint) string
- func FuckIpv6(ip string) string
- func Hosts2Json() []byte
- func ScanAllHostsPublicInfo()
- func ScanC()
- func ScanConfig()
- func ScanHostPublicInfo(host *HostService)
- func ScanPort(ip string, port uint, timeout time.Duration) bool
- func SendPeer(host *HostService)
- func StartServer(publicport uint)
- func Ulimit() int64
- func UpdatePeers()
- func UpdatePeersData()
- type Config
- type DataPoint
- type DataPoolList
- type DataPoolMap
- type HostService
- type HostServiceList
- type InfoStruct
- type Node
- func (n *Node) AppendDataPoint(dataPoint DataPoint) []DataPoint
- func (n *Node) AppendDataPoints(dataPoints []DataPoint) []DataPoint
- func (n *Node) DeleteAllMatchingPrefix(keyStr string) []DataPoint
- func (n *Node) DeleteDataPoint(keyStr string) []DataPoint
- func (n *Node) DeleteDataPointWithPrefix(prefix, key string) []DataPoint
- func (n *Node) GetAllMatchingPrefix(keyStr string) []DataPoint
- func (n *Node) GetDataPoint(keyStr string) DataPoint
- func (n *Node) GetDataPointWithPrefix(prefix, key string) DataPoint
- func (n *Node) JsonDump() []byte
- func (n *Node) SetDataPoint(key string, val []byte) []DataPoint
- func (n *Node) SetDataPointWithPrefix(prefix, key string, val []byte) []DataPoint
- func (n *Node) SetDataPointWithPrefix_iface(prefix, key string, val interface{}) []DataPoint
- func (n *Node) SetDataPointWithPrefix_str(prefix, key string, val string) []DataPoint
- type PortScanner
- type Service
Constants ¶
This section is empty.
Variables ¶
var AppendHostsLock = &sync.Mutex{}
var GlobalScanSemaphore = semaphore.NewWeighted(5)
var HostListLock = sync.Mutex{}
var HostsMap map[string]*HostService
var PortsToScan = []uint{16002}
Functions ¶
func AddHost ¶
func AddHost(h *HostService)
func AddHosts ¶
func AddHosts(hs []*HostService)
func AppendHosts ¶
func AppendHosts(hs []*HostService)
func FormatHttpIpPort ¶
Take an ip, port and return a url without trailing slash
func FormatHttpIpPort_i ¶
As for FormatHttpIpPort, but the port can be a uint
func Hosts2Json ¶
func Hosts2Json() []byte
func ScanAllHostsPublicInfo ¶
func ScanAllHostsPublicInfo()
func ScanConfig ¶
func ScanConfig()
func ScanHostPublicInfo ¶
func ScanHostPublicInfo(host *HostService)
func StartServer ¶
func StartServer(publicport uint)
func UpdatePeers ¶
func UpdatePeers()
Send our host list to all known peers, update our host list based on their response
Types ¶
type Config ¶
type Config struct { HttpPort uint StartPagePort uint Name string MaxUploadSize uint Networks []string KnownPeers []string ArpCheckInterval int PeerUpdateInterval int }
var Configuration Config
type DataPoolList ¶
type DataPoolList []DataPoint
func DataMap2DataList ¶
func DataMap2DataList(dm DataPoolMap) DataPoolList
Convert a map of data points to a list of data points
func (DataPoolList) Len ¶
func (a DataPoolList) Len() int
func (DataPoolList) Less ¶
func (a DataPoolList) Less(i, j int) bool
func (DataPoolList) Swap ¶
func (a DataPoolList) Swap(i, j int)
type DataPoolMap ¶
func DataList2DataMap ¶
func DataList2DataMap(dl DataPoolList) DataPoolMap
Convert a list of data points to a map of data points
type HostService ¶
type HostService struct { GUID string Ip string Ports []uint Port uint Services []Service Name string LastSeen time.Time Path string }
var ThisHost *HostService
func AllHosts ¶
func AllHosts() []*HostService
func ScanNetwork ¶
func ScanNetwork(cidr string, ports []uint) (out []*HostService)
type HostServiceList ¶
type HostServiceList []*HostService
func (HostServiceList) Len ¶
func (a HostServiceList) Len() int
func (HostServiceList) Less ¶
func (a HostServiceList) Less(i, j int) bool
func (HostServiceList) Swap ¶
func (a HostServiceList) Swap(i, j int)
type InfoStruct ¶
var Info InfoStruct
type Node ¶
type Node struct { DataPoolLock sync.Mutex DataPool DataPoolMap }
var ThisNode *Node
func (*Node) AppendDataPoint ¶
Add or update a single data point to the data pool
func (*Node) AppendDataPoints ¶
Add or update a list of data points to the data pool
func (*Node) DeleteAllMatchingPrefix ¶
func (*Node) DeleteDataPoint ¶
func (*Node) DeleteDataPointWithPrefix ¶
func (*Node) GetAllMatchingPrefix ¶
func (*Node) GetDataPoint ¶
Get a single data point
func (*Node) GetDataPointWithPrefix ¶
Get a single data point with a prefix, e.g. "/foo/" and "bar" becomes "/foo/bar"
func (*Node) SetDataPoint ¶
Set a single data point
func (*Node) SetDataPointWithPrefix ¶
Set a single data point with a prefix, e.g. "/foo/" and "bar" becomes "/foo/bar"
func (*Node) SetDataPointWithPrefix_iface ¶
Set a single data point with a prefix, e.g. "/foo/" and "bar" becomes "/foo/bar"
type PortScanner ¶
type PortScanner struct {
// contains filtered or unexported fields
}