seed

package
v0.0.0-...-b80ae54 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	IP   net.IP
	Port uint16
}

type DnsRequest

type DnsRequest struct {
	// contains filtered or unexported fields
}

type DnsServer

type DnsServer struct {
	// contains filtered or unexported fields
}

func NewDnsServer

func NewDnsServer(netview *NetworkView, listenAddr, rootDomain string, realm int) *DnsServer

func (*DnsServer) Serve

func (ds *DnsServer) Serve()

type NetworkView

type NetworkView struct {
	// contains filtered or unexported fields
}

The local view of the network

func NewNetworkView

func NewNetworkView() *NetworkView

func (*NetworkView) AddNode

func (nv *NetworkView) AddNode(node *glightning.Node) Node

Insert nodes into the map of known nodes. Existing nodes with the same Id are overwritten.

func (*NetworkView) RandomSample

func (nv *NetworkView) RandomSample(query NodeType, count int) []Node

Return a random sample matching the NodeType, or just any node if query is set to `0xFF`. Relies on random map-iteration ordering internally.

type Node

type Node struct {
	Id        string
	LastSeen  time.Time
	Type      NodeType
	Addresses []Address
}

Local model of a node,

type NodeType

type NodeType uint8

A bitfield in which bit 0 indicates whether it is an IPv6 if set, and bit 1 indicates whether it uses the default port if set.

Jump to

Keyboard shortcuts

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