This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add events for updated addresses and routing state
- Loading branch information
1 parent
79640cf
commit 6b2771a
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package event | ||
|
||
import ( | ||
"github.com/libp2p/go-libp2p-core/routing" | ||
ma "github.com/multiformats/go-multiaddr" | ||
) | ||
|
||
// EvtLocalAddressesUpdated should be emitted when the set of listen addresses for | ||
// the local host changes. This may happen for a number of reasons. For example, | ||
// we may have opened a new relay connection, established a new NAT mapping via | ||
// UPnP, or been informed of our observed address by another peer. | ||
type EvtLocalAddressesUpdated struct { | ||
// Added enumerates the listen addresses that were added for the local peer. | ||
Added []ma.Multiaddr | ||
|
||
// Removed enumerates listen addresses that were removed from the local peer. | ||
Removed []ma.Multiaddr | ||
} | ||
|
||
// EvtLocalPeerRoutingStateUpdated should be emitted when a new SignedRoutingState | ||
// record for the local peer has been produced. This will happen whenever the set | ||
// of listen addresses changes. | ||
type EvtLocalPeerRoutingStateUpdated struct { | ||
State *routing.SignedRoutingState | ||
} |