prysm-pulse/shared/deprecated-p2p/interfaces.go
Preston Van Loon 82efca9b6f
Move p2p to deprecated-p2p (#3191)
* move to deprecated-p2p

* fix lint

* lint?

* fix lint

* lint

* lint

* lint

* lint
2019-08-13 14:52:04 -04:00

30 lines
844 B
Go

package p2p
import (
"context"
"github.com/gogo/protobuf/proto"
peer "github.com/libp2p/go-libp2p-peer"
"github.com/prysmaticlabs/prysm/shared/event"
)
// Broadcaster represents a subset of the p2p.Server. This interface is useful
// for testing or when the calling code only needs access to the broadcast
// method.
type Broadcaster interface {
Broadcast(context.Context, proto.Message)
}
// Subscriber represents a subset of the p2p.Server. This interface is useful
// for testing or when the calling code only needs access to the subscribe
// method.
type Subscriber interface {
Subscribe(msg proto.Message, channel chan Message) event.Subscription
}
// ReputationManager represents a subset of the p2p.Server which enables
// reputaiton reporting of peers.
type ReputationManager interface {
Reputation(peer peer.ID, val int)
}