forked from ipfs/boxo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To avoid... confusion and angst. This also removes the option to _disable_ it, because there's really no need (not safe to do at runtime anyways). This commit was moved from ipfs/go-bitswap@d3c024e
- 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