go-libp2p-core/event/network.go

17 lines
604 B
Go
Raw Normal View History

2020-02-28 18:36:03 +08:00
package event
2020-03-06 18:28:32 +08:00
import (
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
)
2020-02-28 18:36:03 +08:00
2020-03-06 18:38:03 +08:00
// EvtPeerConnectednessChanged should be emitted every time we form a connection with a peer or drop our last
2020-02-29 14:16:17 +08:00
// connection with the peer. Essentially, it is emitted in two cases:
2020-03-03 16:23:03 +08:00
// a) We form a/any connection with a peer.
2020-02-29 14:16:17 +08:00
// b) We go from having a connection/s with a peer to having no connection with the peer.
2020-03-06 18:28:32 +08:00
// It contains the Id of the remote peer and the new connectedness state.
2020-03-06 18:38:03 +08:00
type EvtPeerConnectednessChanged struct {
Peer peer.ID
2020-03-06 18:28:32 +08:00
Connectedness network.Connectedness
2020-02-28 18:36:03 +08:00
}