go-libp2p-peerstore/peerinfo.go

23 lines
725 B
Go
Raw Normal View History

2016-06-01 02:31:50 +08:00
package peerstore
import (
core "github.com/libp2p/go-libp2p-core/peer"
2018-09-02 19:10:55 +08:00
ma "github.com/multiformats/go-multiaddr"
2016-06-01 02:31:50 +08:00
)
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfo instead.
type PeerInfo = core.AddrInfo
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.ErrInvalidAddr instead.
var ErrInvalidAddr = core.ErrInvalidAddr
2016-06-01 02:31:50 +08:00
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfoFromP2pAddr instead.
func InfoFromP2pAddr(m ma.Multiaddr) (*core.AddrInfo, error) {
return core.AddrInfoFromP2pAddr(m)
2016-06-01 02:31:50 +08:00
}
// Deprecated: use github.com/libp2p/go-libp2p-core/peer.AddrInfoToP2pAddrs instead.
func InfoToP2pAddrs(pi *core.AddrInfo) ([]ma.Multiaddr, error) {
return core.AddrInfoToP2pAddrs(pi)
2016-06-01 02:31:50 +08:00
}