Documentation ¶
Overview ¶
peermonitor is a package for watching peers on a pub sub channel
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventPeerJoin ¶
NewEventPeerJoin creates a new EventPeerJoin event
Types ¶
type EventPeerJoin ¶
EventPeerJoin Is an event triggered when a peer joins the channel
type EventPeerLeave ¶
EventPeerLeave Is an event triggered when a peer leave the channel
type Interface ¶
type Interface interface { events.EmitterInterface // Start Starts watching the topic for new joins or leaves Start(ctx context.Context) func() // Stop Stops the watcher Stop() // GetPeers Lists peers currently present on the topic GetPeers() []peer.ID // HasPeer Checks if a peer is present on the topic HasPeer(id peer.ID) bool // Started Returns whether the peer monitor has been started Started() bool }
Interface Watches for peers on the pub sub, emits messages on join/leave
func NewPeerMonitor ¶
func NewPeerMonitor(ctx context.Context, ipfs coreapi.CoreAPI, topic string, options *NewPeerMonitorOptions) Interface
NewPeerMonitor Creates a new PeerMonitor instance
Click to show internal directories.
Click to hide internal directories.