This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #531 from ipfs/chore/rename-wiretap
fix: rename wiretap to tracer
- Loading branch information
Showing
5 changed files
with
36 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package bitswap | ||
|
||
import ( | ||
bsmsg "github.com/ipfs/go-bitswap/message" | ||
peer "github.com/libp2p/go-libp2p-core/peer" | ||
) | ||
|
||
// Tracer provides methods to access all messages sent and received by Bitswap. | ||
// This interface can be used to implement various statistics (this is original intent). | ||
type Tracer interface { | ||
MessageReceived(peer.ID, bsmsg.BitSwapMessage) | ||
MessageSent(peer.ID, bsmsg.BitSwapMessage) | ||
} | ||
|
||
// Configures Bitswap to use given tracer. | ||
func WithTracer(tap Tracer) Option { | ||
return func(bs *Bitswap) { | ||
bs.tracer = tap | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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