mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-01 20:43:43 +01:00
49e9113e0f
Print peer status from the package Added --detail flag for detailed status output
26 lines
445 B
Go
26 lines
445 B
Go
package peer
|
|
|
|
import log "github.com/sirupsen/logrus"
|
|
|
|
type ConnStatus int
|
|
|
|
func (s ConnStatus) String() string {
|
|
switch s {
|
|
case StatusConnecting:
|
|
return "Connecting"
|
|
case StatusConnected:
|
|
return "Connected"
|
|
case StatusDisconnected:
|
|
return "Disconnected"
|
|
default:
|
|
log.Errorf("unknown status: %d", s)
|
|
return "INVALID_PEER_CONNECTION_STATUS"
|
|
}
|
|
}
|
|
|
|
const (
|
|
StatusConnected ConnStatus = iota
|
|
StatusConnecting
|
|
StatusDisconnected
|
|
)
|