network.go 602 Bytes
Newer Older
Aarsh Shah's avatar
Aarsh Shah committed
1 2
package event

Aarsh Shah's avatar
Aarsh Shah committed
3 4 5 6
import (
	"github.com/libp2p/go-libp2p-core/network"
	"github.com/libp2p/go-libp2p-core/peer"
)
Aarsh Shah's avatar
Aarsh Shah committed
7

Aarsh Shah's avatar
Aarsh Shah committed
8
// EvtPeerConnectednessChange should be emitted every time we form a connection with a peer or drop our last
Aarsh Shah's avatar
Aarsh Shah committed
9
// connection with the peer. Essentially, it is emitted in two cases:
Aarsh Shah's avatar
Aarsh Shah committed
10
// a) We form a/any connection with a peer.
Aarsh Shah's avatar
Aarsh Shah committed
11
// b) We go from having a connection/s with a peer to having no connection with the peer.
Aarsh Shah's avatar
Aarsh Shah committed
12 13 14 15
// It contains the Id of the remote peer and the new connectedness state.
type EvtPeerConnectednessChange struct {
	RemotePeerId  peer.ID
	Connectedness network.Connectedness
Aarsh Shah's avatar
Aarsh Shah committed
16
}