Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddrSource ¶
type AddrSource = func() []TransportAddr
AddrSource returns a list of addresses suitable for advertisement.
type Params ¶
type Params struct { // Outbound LocalAddr inet256.Addr AddrSource AddrSource // Inbound PeerStore peers.Store[TransportAddr] ParseAddr func([]byte) (TransportAddr, error) }
type Service ¶
type Service interface { // Run should run until the context is cancelled, calling params.AddrSource to // get the local addresses, and storing discovered addresses in params.PeerStore Run(ctx context.Context, params Params) error }
Service manages the peers in a PeerStore, adding to and removing from them automatically as peers are discovered and lost.
type TransportAddr ¶ added in v0.0.3
type TransportAddr = multiswarm.Addr
Click to show internal directories.
Click to hide internal directories.