mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2024-12-26 23:30:27 +08:00
12 lines
259 B
Go
12 lines
259 B
Go
package host
|
|
|
|
import "github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
// InfoFromHost returns a peer.AddrInfo struct with the Host's ID and all of its Addrs.
|
|
func InfoFromHost(h Host) *peer.AddrInfo {
|
|
return &peer.AddrInfo{
|
|
ID: h.ID(),
|
|
Addrs: h.Addrs(),
|
|
}
|
|
}
|