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. TODO: The code here gets horribly hairy, so we should refactor this at some point
func NewDiscovery ¶
NewDiscovery constructs a new discovery.
func (*Discovery) Advertise ¶
Advertise is a utility function that persistently advertises a service through an Advertiser. TODO: Start advertising only after the reachability is confirmed by AutoNAT
func (*Discovery) Peers ¶ added in v0.5.0
Peers provides a list of discovered peers in the "full" topic. If Discovery hasn't found any peers, it blocks until at least one peer is found.
func (*Discovery) WithOnPeersUpdate ¶ added in v0.6.3
func (d *Discovery) WithOnPeersUpdate(f OnUpdatedPeers)
WithOnPeersUpdate chains OnPeersUpdate callbacks on every update of discovered peers list.
type OnUpdatedPeers ¶ added in v0.6.3
type Parameters ¶ added in v0.9.2
type Parameters struct {
// PeersLimit defines the soft limit of FNs to connect to via discovery.
// Set 0 to disable.
PeersLimit uint
// AdvertiseInterval is a interval between advertising sessions.
// Set -1 to disable.
// NOTE: only full and bridge can advertise themselves.
AdvertiseInterval time.Duration
// contains filtered or unexported fields
}
func DefaultParameters ¶ added in v0.9.2
func DefaultParameters() Parameters
Click to show internal directories.
Click to hide internal directories.