discovery

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KadDhtDiscoverer

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

KadDhtDiscoverer is the kad-dht discovery type implementation

func NewKadDhtPeerDiscoverer

func NewKadDhtPeerDiscoverer(
	refreshInterval time.Duration,
	randezVous string,
	initialPeersList []string) *KadDhtDiscoverer

NewKadDhtPeerDiscoverer creates a new kad-dht discovery type implementation initialPeersList can be nil or empty, no initial connection will be attempted, a warning message will appear

func (*KadDhtDiscoverer) ApplyContext

func (kdd *KadDhtDiscoverer) ApplyContext(ctxProvider p2p.ContextProvider) error

ApplyContext sets the context in which this discoverer is to be run

func (*KadDhtDiscoverer) Bootstrap

func (kdd *KadDhtDiscoverer) Bootstrap() error

Bootstrap will start the bootstrapping new peers process

func (*KadDhtDiscoverer) Name

func (kdd *KadDhtDiscoverer) Name() string

Name returns the name of the kad dht peer discovery implementation

func (*KadDhtDiscoverer) ReconnectToNetwork

func (kdd *KadDhtDiscoverer) ReconnectToNetwork() <-chan struct{}

ReconnectToNetwork will try to connect to one peer from the initial peer list

type MdnsPeerDiscoverer

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

MdnsPeerDiscoverer is the mdns discovery type implementation

func NewMdnsPeerDiscoverer

func NewMdnsPeerDiscoverer(refreshInterval time.Duration, serviceTag string) *MdnsPeerDiscoverer

NewMdnsPeerDiscoverer creates a new mdns discovery type implementation if serviceTag provided is empty, a default mdns serviceTag will be applied

func (*MdnsPeerDiscoverer) ApplyContext

func (mpd *MdnsPeerDiscoverer) ApplyContext(ctxProvider p2p.ContextProvider) error

ApplyContext sets the context in which this discoverer is to be run

func (*MdnsPeerDiscoverer) Bootstrap

func (mpd *MdnsPeerDiscoverer) Bootstrap() error

Bootstrap will start the bootstrapping new peers process

func (*MdnsPeerDiscoverer) HandlePeerFound

func (mpd *MdnsPeerDiscoverer) HandlePeerFound(pi peerstore.PeerInfo)

HandlePeerFound updates the routing table with this new peer

func (*MdnsPeerDiscoverer) Name

func (mpd *MdnsPeerDiscoverer) Name() string

Name returns the name of the mdns peer discovery implementation

type NullDiscoverer

type NullDiscoverer struct {
}

NullDiscoverer is the non-functional peer discoverer aimed to be used when peer discovery options are all disabled

func NewNullDiscoverer

func NewNullDiscoverer() *NullDiscoverer

NewNullDiscoverer creates a new NullDiscoverer implementation

func (*NullDiscoverer) ApplyContext

func (nd *NullDiscoverer) ApplyContext(ctxProvider p2p.ContextProvider) error

ApplyContext is an empty func as the context is not required

func (*NullDiscoverer) Bootstrap

func (nd *NullDiscoverer) Bootstrap() error

Bootstrap will return nil. There is no implementation.

func (*NullDiscoverer) Name

func (nd *NullDiscoverer) Name() string

Name returns the name of the mdns peer discovery implementation

Jump to

Keyboard shortcuts

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