From c367533a3cd5f901ea474d17d7ea510331573439 Mon Sep 17 00:00:00 2001 From: Mak Muftic Date: Fri, 10 Sep 2021 12:36:38 +0200 Subject: [PATCH] Add transport interface --- node/modules/{lp2p => tracer}/tracer.go | 10 ++++++---- node/modules/tracer/transport.go | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) rename node/modules/{lp2p => tracer}/tracer.go (75%) create mode 100644 node/modules/tracer/transport.go diff --git a/node/modules/lp2p/tracer.go b/node/modules/tracer/tracer.go similarity index 75% rename from node/modules/lp2p/tracer.go rename to node/modules/tracer/tracer.go index 36dd6d456..a19ae065d 100644 --- a/node/modules/lp2p/tracer.go +++ b/node/modules/tracer/tracer.go @@ -1,4 +1,4 @@ -package lp2p +package tracer import ( peer "github.com/libp2p/go-libp2p-core/peer" @@ -6,14 +6,16 @@ import ( pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" ) -func newLotusTracer(tr pubsub.EventTracer) LotusTracer { +func newLotusTracer(et pubsub.EventTracer, tt TracerTransport) LotusTracer { return &lotusTracer{ - tr: tr, + et: et, + tt: tt, } } type lotusTracer struct { - tr pubsub.EventTracer + et pubsub.EventTracer + tt TracerTransport } type LotusTracer interface { diff --git a/node/modules/tracer/transport.go b/node/modules/tracer/transport.go new file mode 100644 index 000000000..73ef80690 --- /dev/null +++ b/node/modules/tracer/transport.go @@ -0,0 +1,5 @@ +package tracer + +type TracerTransport interface { + Transport(jsonEvent []byte) +}