Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery combines advertise and discover services and allows to store discovered nodes.
func NewDiscovery ¶
func NewDiscovery( h host.Host, d core.Discovery, peersLimit uint, discInterval, advertiseInterval time.Duration, ) *Discovery
NewDiscovery constructs a new discovery.
func (*Discovery) Advertise ¶
Advertise is a utility function that persistently advertises a service through an Advertiser.
func (*Discovery) EnsurePeers ¶
EnsurePeers ensures we always have 'peerLimit' connected peers. It starts peer discovery every 30 seconds until peer cache reaches peersLimit. Discovery is restarted if any previously connected peers disconnect.
Click to show internal directories.
Click to hide internal directories.