Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ValidationAccept should be returned if message is good and can be broadcasted. ValidationAccept = pubsub.ValidationAccept // ValidationIgnore should be returned if message might be good, but outdated // and shouldn't be broadcasted. ValidationIgnore = pubsub.ValidationIgnore // ValidationReject should be returned if message is malformed or malicious // and shouldn't be broadcasted. Peer might be potentially get banned when on this result. ValidationReject = pubsub.ValidationReject )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GossipHandler ¶
GossipHandler is a function that is for receiving messages.
func ChainGossipHandler ¶
func ChainGossipHandler(handlers ...GossipHandler) GossipHandler
ChainGossipHandler helper to chain multiple GossipHandler together. Called synchronously and in the order.
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub is a spacemesh-specific wrapper around gossip protocol.
func (*PubSub) ProtocolPeers ¶
ProtocolPeers returns list of peers that are communicating in a given protocol.
func (*PubSub) Register ¶
func (ps *PubSub) Register(topic string, handler GossipHandler)
Register handler for topic.
type PublishSubsciber ¶
type PublishSubsciber interface { Publisher Subscriber }
PublishSubsciber common interface for publisher and subscribing.
type Subscriber ¶
type Subscriber interface {
Register(string, GossipHandler)
}
Subscriber is an interface for subcribing to messages.
type ValidationResult ¶
type ValidationResult = pubsub.ValidationResult
ValidationResult is a one of the validation result constants.
Click to show internal directories.
Click to hide internal directories.