discovery

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrList

type AddrList []maddr.Multiaddr

A new type we need for writing a custom flag parser

func (*AddrList) Set

func (al *AddrList) Set(value string) error

func (*AddrList) String

func (al *AddrList) String() string

type DHT

type DHT struct {
	OTPKey           string
	OTPInterval      int
	KeyLength        int
	RendezvousString string
	BootstrapPeers   AddrList

	RefreshDiscoveryTime time.Duration
	*dht.IpfsDHT
	// contains filtered or unexported fields
}

func NewDHT added in v0.8.4

func NewDHT(d ...dht.Option) *DHT

func (*DHT) FindClosePeers added in v0.16.1

func (d *DHT) FindClosePeers(ll log.StandardLogger, onlyStaticRelays bool, static ...string) func(ctx context.Context, numPeers int) <-chan peer.AddrInfo

func (*DHT) Option

func (d *DHT) Option(ctx context.Context) func(c *libp2p.Config) error

func (*DHT) Rendezvous

func (d *DHT) Rendezvous() string

func (*DHT) Run

func (d *DHT) Run(c log.StandardLogger, ctx context.Context, host host.Host) error

type MDNS

type MDNS struct {
	DiscoveryServiceTag string

	// InterfaceFilter, when set, restricts the network interfaces mDNS runs on and
	// advertises addresses from. mDNS only considers interfaces that are up and
	// support multicast; the filter can narrow that set further, for example to
	// Wi-Fi and Ethernet so that mobile data and VPN addresses are not advertised.
	// Only the Android implementation uses it. On other platforms go-libp2p's mDNS
	// service picks the interfaces and this field is ignored.
	InterfaceFilter func(net.Interface) bool
}

func (*MDNS) Option

func (d *MDNS) Option(ctx context.Context) func(c *libp2p.Config) error

func (*MDNS) Run

func (d *MDNS) Run(l log.StandardLogger, ctx context.Context, host host.Host) error

type Ring added in v0.28.0

type Ring struct {
	Data   []string
	Length int
}

func (*Ring) Add added in v0.28.0

func (r *Ring) Add(s string)

Jump to

Keyboard shortcuts

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