p2p

package
v0.0.0-...-3b62c27 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLogging

func DisableLogging()

DisableLogging will disable logging

func DiscoverOnce

func DiscoverOnce(self peer.ID, service string) (<-chan peer.AddrInfo, error)

DiscoverOnce will run an mDNS query once and return a channel of peer addresses.

func Logger

func Logger() *logrus.Logger

Logger returns the logger

Types

type DiscoveredPeer

type DiscoveredPeer struct {
	ID        peer.ID
	Addrs     []multiaddr.Multiaddr
	ConnState network.Connectedness
}

DiscoveredPeer is a peer that has been found in network discovery.

type Discovery

type Discovery struct {
	Host       host.Host
	Service    string
	Duration   time.Duration
	ListenAddr net.IP
}

Discovery is a discovery struct that holds discovery parameters

func (*Discovery) Start

func (d *Discovery) Start() (<-chan peer.AddrInfo, error)

Start will start the discovery goroutine and return a channel of discovered addresses

func (*Discovery) StartContext

func (d *Discovery) StartContext(ctx context.Context) (<-chan peer.AddrInfo, error)

StartContext will start a mdns discovery service that will send new peers down the channel

Jump to

Keyboard shortcuts

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