discovery

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdvertiseSSDP

func AdvertiseSSDP(ctx context.Context, nickname string, port int) (stop func(), err error)

func BrowseBonjour

func BrowseBonjour(ctx context.Context, mgr *Manager) (stop func(), err error)

func ListenWSD

func ListenWSD(ctx context.Context, mgr *Manager) error

func RegisterBonjour

func RegisterBonjour(nickname string, port int, fullAddrs []multiaddr.Multiaddr) (*zeroconf.Server, error)

func SearchSSDP

func SearchSSDP(ctx context.Context, mgr *Manager) (stop func(), err error)

func SendWSDHello

func SendWSDHello(ctx context.Context, nickname string, port int) error

func StartBLE

func StartBLE(ctx context.Context, nickname string, mgr *Manager) error

StartBLE is a no-op when compiled without -tags ble.

Types

type DiscoveredPeer

type DiscoveredPeer struct {
	ID       peer.ID
	Nickname string
	Addrs    []multiaddr.Multiaddr
	Addr     string // fallback for non-libp2p proximity signals (BLE)
	Source   string // "mdns", "ssdp", "wsd", "ble", "dht"
}

type Manager

type Manager struct {
	OnPeerFound func(DiscoveredPeer)
	OnPeerLost  func(DiscoveredPeer)
	// contains filtered or unexported fields
}

func NewManager

func NewManager(nickname string) *Manager

func (*Manager) Forget

func (m *Manager) Forget(key string)

func (*Manager) Notify

func (m *Manager) Notify(p DiscoveredPeer)

Jump to

Keyboard shortcuts

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