Add transport interface

This commit is contained in:
Mak Muftic 2021-09-10 12:36:38 +02:00
parent b1dafd81b8
commit c367533a3c
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
package lp2p package tracer
import ( import (
peer "github.com/libp2p/go-libp2p-core/peer" peer "github.com/libp2p/go-libp2p-core/peer"
@ -6,14 +6,16 @@ import (
pubsub_pb "github.com/libp2p/go-libp2p-pubsub/pb" 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{ return &lotusTracer{
tr: tr, et: et,
tt: tt,
} }
} }
type lotusTracer struct { type lotusTracer struct {
tr pubsub.EventTracer et pubsub.EventTracer
tt TracerTransport
} }
type LotusTracer interface { type LotusTracer interface {

View File

@ -0,0 +1,5 @@
package tracer
type TracerTransport interface {
Transport(jsonEvent []byte)
}