-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce routability and protocol events; cache unmarshalled RSA keys (
#105) * event: Add autonat events (#25) * add events for identify (#26) * implement caching for rsaKey.Bytes() * store marshalled protobuf in cache for RsaPublicKey.Bytes() * fix(crypto): fix build when openssl is enabled * add godocs to routability events. Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com> Co-authored-by: Whyrusleeping <why@ipfs.io> Co-authored-by: Adin Schmahmann <adin.schmahmann@gmail.com> Co-authored-by: Steven Allen <steven@stebalien.com>
- Loading branch information
1 parent
ca6e701
commit 628240f
Showing
8 changed files
with
84 additions
and
12 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
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
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
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
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
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
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,17 @@ | ||
package event | ||
|
||
import "github.com/libp2p/go-libp2p-core/peer" | ||
|
||
// EvtPeerIdentificationCompleted is emitted when the initial identification round for a peer is completed. | ||
type EvtPeerIdentificationCompleted struct { | ||
// Peer is the ID of the peer whose identification succeeded. | ||
Peer peer.ID | ||
} | ||
|
||
// EvtPeerIdentificationFailed is emitted when the initial identification round for a peer failed. | ||
type EvtPeerIdentificationFailed struct { | ||
// Peer is the ID of the peer whose identification failed. | ||
Peer peer.ID | ||
// Reason is the reason why identification failed. | ||
Reason error | ||
} |
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,21 @@ | ||
package event | ||
|
||
// EvtLocalRoutabilityPrivate is an event struct to be emitted with the local's | ||
// node routability changes to PRIVATE (i.e. not routable from the Internet). | ||
// | ||
// This event is usually emitted by the AutoNAT subsystem. | ||
type EvtLocalRoutabilityPrivate struct{} | ||
|
||
// EvtLocalRoutabilityPublic is an event struct to be emitted with the local's | ||
// node routability changes to PUBLIC (i.e. appear to routable from the | ||
// Internet). | ||
// | ||
// This event is usually emitted by the AutoNAT subsystem. | ||
type EvtLocalRoutabilityPublic struct{} | ||
|
||
// EvtLocalRoutabilityUnknown is an event struct to be emitted with the local's | ||
// node routability changes to UNKNOWN (i.e. we were unable to make a | ||
// determination about our NAT status with enough confidence). | ||
// | ||
// This event is usually emitted by the AutoNAT subsystem. | ||
type EvtLocalRoutabilityUnknown struct{} |