Documentation
¶
Overview ¶
Package addr provides utility functions to handle peer addresses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slice ¶
type Slice []ma.Multiaddr
Slice is a simple slice of addresses that implements the AddrSource interface.
type Source ¶
type Source interface {
Addrs() []ma.Multiaddr
}
AddrSource is a source of addresses. It allows clients to retrieve a set of addresses at a last possible moment in time. It is used to query a set of addresses that may change over time, as a result of the network changing interfaces or mappings.
func CombineSources ¶
func CombineSources(srcs ...Source) Source
CombineSources returns a new AddrSource which is the concatenation of all input AddrSources:
combined := CombinedSources(a, b)
combined.Addrs() // append(a.Addrs(), b.Addrs()...)
func UniqueSource ¶
func UniqueSource(srcs ...Source) Source
UniqueSource returns a new AddrSource which omits duplicate addresses from the inputs:
unique := UniqueSource(a, b)
unique.Addrs() // append(a.Addrs(), b.Addrs()...)
// but only adds each addr once.
Click to show internal directories.
Click to hide internal directories.