Add lotus tracer interface
This commit is contained in:
parent
d61612e05b
commit
522858c871
26
node/modules/lp2p/tracer.go
Normal file
26
node/modules/lp2p/tracer.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package lp2p
|
||||||
|
|
||||||
|
import (
|
||||||
|
peer "github.com/libp2p/go-libp2p-core/peer"
|
||||||
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
|
pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newLotusTracer(tr pubsub.EventTracer) LotusTracer {
|
||||||
|
return &lotusTracer{
|
||||||
|
tr: tr,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type lotusTracer struct {
|
||||||
|
tr pubsub.EventTracer
|
||||||
|
}
|
||||||
|
|
||||||
|
type LotusTracer interface {
|
||||||
|
TracePeerScore(scores map[peer.ID]*pubsub.PeerScoreSnapshot)
|
||||||
|
Trace(evt *pubsub_pb.TraceEvent)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (lt *lotusTracer) TracePeerScore(scores map[peer.ID]*pubsub.PeerScoreSnapshot) {}
|
||||||
|
|
||||||
|
func (lt *lotusTracer) Trace(evt *pubsub_pb.TraceEvent) {}
|
Loading…
Reference in New Issue
Block a user