Documentation ¶
Overview ¶
Package events contains a simple p2p event system implementation, that simplifies asynchronous event flows in the p2p module. The event subscriptions allow for event filtering, which eases the load on the event notification flow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { // Type returns the type information for the event Type() EventType }
Event is a generic p2p event
type EventFilter ¶
EventFilter is the filter function used to filter incoming p2p events. A false flag will consider the event as irrelevant
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is the p2p event switch
func (*Events) Subscribe ¶
func (es *Events) Subscribe(filterFn EventFilter) (<-chan Event, func())
Subscribe registers a new filtered event listener
type PeerConnectedEvent ¶
type PeerConnectedEvent struct { PeerID types.ID // the ID of the peer Address net.Addr // the remote address of the peer }
func (PeerConnectedEvent) Type ¶
func (p PeerConnectedEvent) Type() EventType
Click to show internal directories.
Click to hide internal directories.