listener

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolEventCallback

type BoolEventCallback func(bool)

type BundleEventCallback

type BundleEventCallback func(bundle.Bundle)

type CallbackEventListener

type CallbackEventListener struct {
	// contains filtered or unexported fields
}

CallbackEventListener handles callbacks and registration for events against an EventMachine.

func NewCallbackEventListener

func NewCallbackEventListener(em event.EventMachine) *CallbackEventListener

NewCallbackEventListener creates a new CallbackEventListener using the given EventMachine.

func (*CallbackEventListener) Close

func (el *CallbackEventListener) Close() error

Close unregisters all callbacks from the EventMachine.

func (*CallbackEventListener) RegAccountShutdown

func (el *CallbackEventListener) RegAccountShutdown(f SignalEventCallback)

RegAccountShutdown registers this listener to listen for shutdown messages. A shutdown signal is normally only signaled once by the account on it's graceful termination.

func (*CallbackEventListener) RegAttachingToTangle

func (el *CallbackEventListener) RegAttachingToTangle(f SignalEventCallback)

RegAttachingToTangle registers this listener to listen to when Proof-of-Work is executed.

func (*CallbackEventListener) RegConfirmedTransfers

func (el *CallbackEventListener) RegConfirmedTransfers(f BundleEventCallback)

RegConfirmedTransfers registers the given callback to execute when a transfer got confirmed.

func (*CallbackEventListener) RegGettingTransactionsToApprove

func (el *CallbackEventListener) RegGettingTransactionsToApprove(f SignalEventCallback)

RegGettingTransactionsToApprove registers this listener to listen to when transactions to approve are getting fetched.

func (*CallbackEventListener) RegInputSelection

func (el *CallbackEventListener) RegInputSelection(f BoolEventCallback)

RegInputSelection registers this listener to listen to when input selection is executed.

func (*CallbackEventListener) RegInternalErrors

func (el *CallbackEventListener) RegInternalErrors(f ErrorCallback)

RegInternalErrors registers this listener to listen for internal account errors.

func (*CallbackEventListener) RegPreparingTransfer

func (el *CallbackEventListener) RegPreparingTransfer(f SignalEventCallback)

RegPreparingTransfer registers this listener to listen to when a transfer is being prepared.

func (*CallbackEventListener) RegPromotions

RegPromotions registers the given callback to execute on promotions.

func (*CallbackEventListener) RegReattachments

RegReattachments registers the given callback to execute on reattachments.

func (*CallbackEventListener) RegReceivedDeposits

func (el *CallbackEventListener) RegReceivedDeposits(f BundleEventCallback)

RegReceivedDeposits registers this listener to listen for received (confirmed) deposits.

func (*CallbackEventListener) RegReceivedMessages

func (el *CallbackEventListener) RegReceivedMessages(f BundleEventCallback)

RegReceivedMessages registers this listener to listen for incoming messages.

func (*CallbackEventListener) RegReceivingDeposits

func (el *CallbackEventListener) RegReceivingDeposits(f BundleEventCallback)

RegReceivingDeposits registers the given callback to execute when a new deposit is being received.

func (*CallbackEventListener) RegSentTransfers

func (el *CallbackEventListener) RegSentTransfers(f BundleEventCallback)

RegSentTransfers registers the given callback to execute when a transfer is sent off.

type ChannelEventListener

type ChannelEventListener struct {
	Promoted                     chan *promoter.PromotionReattachmentEvent
	Reattached                   chan *promoter.PromotionReattachmentEvent
	SentTransfer                 chan bundle.Bundle
	TransferConfirmed            chan bundle.Bundle
	ReceivingDeposit             chan bundle.Bundle
	ReceivedDeposit              chan bundle.Bundle
	ReceivedMessage              chan bundle.Bundle
	InternalError                chan error
	ExecutingInputSelection      chan bool
	PreparingTransfers           chan struct{}
	GettingTransactionsToApprove chan struct{}
	AttachingToTangle            chan struct{}
	Shutdown                     chan struct{}
	// contains filtered or unexported fields
}

ChannelEventListener handles channels and registration for events against an EventMachine. Use the builder methods to register this listener against certain events. Once registered for events, you must listen for incoming events on the specific channel.

func NewChannelEventListener

func NewChannelEventListener(em event.EventMachine) *ChannelEventListener

NewChannelEventListener creates a new ChannelEventListener using the given EventMachine.

func (*ChannelEventListener) All

All sets this listener up to listen to all account events.

func (*ChannelEventListener) Close

func (el *ChannelEventListener) Close() error

Close frees up all underlying channels from the EventMachine.

func (*ChannelEventListener) RegAccountShutdown

func (el *ChannelEventListener) RegAccountShutdown() *ChannelEventListener

RegAccountShutdown registers this listener to listen for shutdown messages. A shutdown signal is normally only signaled once by the account on it's graceful termination.

func (*ChannelEventListener) RegAttachingToTangle

func (el *ChannelEventListener) RegAttachingToTangle() *ChannelEventListener

RegAttachingToTangle registers this listener to listen to when Proof-of-Work is executed.

func (*ChannelEventListener) RegConfirmedTransfers

func (el *ChannelEventListener) RegConfirmedTransfers() *ChannelEventListener

RegConfirmedTransfers registers this listener to listen for sent off confirmed transfers.

func (*ChannelEventListener) RegGettingTransactionsToApprove

func (el *ChannelEventListener) RegGettingTransactionsToApprove() *ChannelEventListener

RegGettingTransactionsToApprove registers this listener to listen to when transactions to approve are getting fetched.

func (*ChannelEventListener) RegInputSelection

func (el *ChannelEventListener) RegInputSelection() *ChannelEventListener

RegInputSelection registers this listener to listen to when input selection is executed.

func (*ChannelEventListener) RegInternalErrors

func (el *ChannelEventListener) RegInternalErrors() *ChannelEventListener

RegInternalErrors registers this listener to listen for internal account errors.

func (*ChannelEventListener) RegPreparingTransfer

func (el *ChannelEventListener) RegPreparingTransfer() *ChannelEventListener

RegPreparingTransfer registers this listener to listen to when a transfer is being prepared.

func (*ChannelEventListener) RegPromotions

func (el *ChannelEventListener) RegPromotions() *ChannelEventListener

RegPromotions registers this listener to listen for promotions.

func (*ChannelEventListener) RegReattachments

func (el *ChannelEventListener) RegReattachments() *ChannelEventListener

RegReattachments registers this listener to listen for reattachments.

func (*ChannelEventListener) RegReceivedDeposits

func (el *ChannelEventListener) RegReceivedDeposits() *ChannelEventListener

RegReceivedDeposits registers this listener to listen for received (confirmed) deposits.

func (*ChannelEventListener) RegReceivedMessages

func (el *ChannelEventListener) RegReceivedMessages() *ChannelEventListener

RegReceivedMessages registers this listener to listen for incoming messages.

func (*ChannelEventListener) RegReceivingDeposits

func (el *ChannelEventListener) RegReceivingDeposits() *ChannelEventListener

RegReceivingDeposits registers this listener to listen for incoming deposits which are not yet confirmed.

func (*ChannelEventListener) RegSentTransfers

func (el *ChannelEventListener) RegSentTransfers() *ChannelEventListener

RegSentTransfers registers this listener to listen for sent off transfers.

type ErrorCallback

type ErrorCallback func(error)

type PromotionReattachmentEventCallback

type PromotionReattachmentEventCallback func(*promoter.PromotionReattachmentEvent)

type SignalEventCallback

type SignalEventCallback func()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL