rename routability -> reachability

This commit is contained in:
Steven Allen 2020-03-04 12:43:11 -08:00
parent 8157087fc9
commit e5f43bb541
3 changed files with 22 additions and 21 deletions

13
event/reachability.go Normal file
View File

@ -0,0 +1,13 @@
package event
import (
"github.com/libp2p/go-libp2p-core/network"
)
// EvtLocalReachabilityChanged is an event struct to be emitted when the local's
// node reachability changes state.
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalReachabilityChanged struct {
Reachability network.Reachability
}

View File

@ -1,13 +0,0 @@
package event
import (
"github.com/libp2p/go-libp2p-core/network"
)
// EvtLocalRoutability is an event struct to be emitted with the local's node
// routability changes state.
//
// This event is usually emitted by the AutoNAT subsystem.
type EvtLocalRoutability struct {
Routability network.Routability
}

View File

@ -53,22 +53,23 @@ const (
CannotConnect
)
// Routability indicates how reachable a node is.
type Routability int
// Reachability indicates how reachable a node is.
type Reachability int
const (
// RoutabilityUnknown indicates that the routability status is unknown.
RoutabilityUnknown = iota
// ReachabilityUnknown indicates that the reachability status of the
// node is unknown.
ReachabilityUnknown = iota
// RoutabilityPublic indicates that the node is reachable from the
// ReachabilityPublic indicates that the node is reachable from the
// public internet.
RoutabilityPublic
ReachabilityPublic
// RoutabilityPrivate indicates that the node is not reachable from the
// ReachabilityPrivate indicates that the node is not reachable from the
// public internet.
//
// NOTE: This node may _still_ be reachable via relays.
RoutabilityPrivate
ReachabilityPrivate
)
// Stat stores metadata pertaining to a given Stream/Conn.