Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
Types ¶
type PeerNotifier ¶
type PeerNotifier struct {
// contains filtered or unexported fields
}
PeerNotifier is a subsystem which observes peer offline and online events. It takes subscriptions for its events, and whenever it observes a new event it notifies its subscribers over the proper channel.
func New ¶
func New() *PeerNotifier
New creates a new peer notifier which notifies clients of peer online and offline events.
func (*PeerNotifier) NotifyPeerOffline ¶
func (p *PeerNotifier) NotifyPeerOffline(pubKey [33]byte)
NotifyPeerOffline sends a peer offline event to all the clients subscribed to the peer notifier.
func (*PeerNotifier) NotifyPeerOnline ¶
func (p *PeerNotifier) NotifyPeerOnline(pubKey [33]byte)
NotifyPeerOnline sends a peer online event to all clients subscribed to the peer notifier.
func (*PeerNotifier) Start ¶
func (p *PeerNotifier) Start() error
Start starts the PeerNotifier's subscription server.
func (*PeerNotifier) Stop ¶
func (p *PeerNotifier) Stop() error
Stop signals the notifier for a graceful shutdown.
func (*PeerNotifier) SubscribePeerEvents ¶
func (p *PeerNotifier) SubscribePeerEvents() (*subscribe.Client, error)
SubscribePeerEvents returns a subscribe.Client that will receive updates any time the Server is informed of a peer event.
type PeerOfflineEvent ¶
type PeerOfflineEvent struct { // PubKey is the peer's compressed public key. PubKey [33]byte }
PeerOfflineEvent represents a new event where a peer goes offline.
type PeerOnlineEvent ¶
type PeerOnlineEvent struct { // PubKey is the peer's compressed public key. PubKey [33]byte }
PeerOnlineEvent represents a new event where a peer comes online.