go-libp2p-pubsub/trace.go

95 lines
1.3 KiB
Go
Raw Normal View History

2019-11-04 17:22:14 +00:00
package pubsub
import (
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
)
// Generic event tracer interface
type EventTracer interface {
Trace(evt interface{})
}
type pubsubTracer struct {
tracer EventTracer
pid peer.ID
2019-11-04 17:22:14 +00:00
}
2019-11-04 18:04:55 +00:00
func (t *pubsubTracer) PublishMessage(msg *Message) {
if t != nil {
// TODO
}
}
2019-11-04 17:22:14 +00:00
func (t *pubsubTracer) RejectMessage(msg *Message, reason string) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) DuplicateMessage(msg *Message) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) DeliverMessage(msg *Message) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) AddPeer(p peer.ID, proto protocol.ID) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) RemovePeer(p peer.ID) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) RecvRPC(rpc *RPC) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) SendRPC(rpc *RPC, p peer.ID) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) DropRPC(rpc *RPC, p peer.ID) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) Join(topic string) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) Leave(topic string) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) Graft(p peer.ID, topic string) {
if t != nil {
// TODO
}
}
func (t *pubsubTracer) Prune(p peer.ID, topic string) {
if t != nil {
// TODO
}
}