1
0
mirror of https://github.com/libp2p/go-libp2p-core.git synced 2025-04-28 17:10:14 +08:00

add top-level aliases for central primitives of go-libp2p.

This commit is contained in:
Raúl Kripalani 2019-04-22 11:44:49 +01:00
parent 978f710c58
commit ec2a527976

54
alias.go Normal file
View File

@ -0,0 +1,54 @@
// Package core provides aliases for foundational, central go-libp2p primitives for convenient access.
package core
import (
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/multiformats/go-multiaddr"
)
// ENTITIES.
// Multiaddr aliases the Multiaddr type from github.com/multiformats/go-multiaddr.
//
// Refer to the docs on that type for more info.
type Multiaddr = multiaddr.Multiaddr
// PeerID aliases peer.ID.
//
// Refer to the docs on that type for more info.
type PeerID = peer.ID
// PeerID aliases protocol.ID.
//
// Refer to the docs on that type for more info.
type ProtocolID = protocol.ID
// PeerInfo aliases peer.Info.
//
// Refer to the docs on that type for more info.
type PeerInfo = peer.Info
// CONSTRUCTIONS.
// Host aliases host.Host.
//
// Refer to the docs on that type for more info.
type Host = host.Host
// Network aliases network.Network.
//
// Refer to the docs on that type for more info.
type Network = network.Network
// Conn aliases network.Conn.
//
// Refer to the docs on that type for more info.
type Conn = network.Conn
// Stream aliases network.Stream.
//
// Refer to the docs on that type for more info.
type Stream = network.Stream