mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-09 07:28:18 +01:00
26 lines
452 B
Go
26 lines
452 B
Go
|
package peer
|
||
|
|
||
|
import log "github.com/sirupsen/logrus"
|
||
|
|
||
|
type ConnStatus int
|
||
|
|
||
|
func (s ConnStatus) String() string {
|
||
|
switch s {
|
||
|
case StatusConnecting:
|
||
|
return "StatusConnecting"
|
||
|
case StatusConnected:
|
||
|
return "StatusConnected"
|
||
|
case StatusDisconnected:
|
||
|
return "StatusDisconnected"
|
||
|
default:
|
||
|
log.Errorf("unknown status: %d", s)
|
||
|
return "INVALID_PEER_CONNECTION_STATUS"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
StatusConnected = iota
|
||
|
StatusConnecting
|
||
|
StatusDisconnected
|
||
|
)
|