notifier

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ALL_NOTIFICATIONS = "all"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelNotifier

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

ChannelNotifier is used to notify multiple listeners of a channel update.

func NewChannelNotifier

func NewChannelNotifier(store store.Store, vm *payments.VoucherManager) *ChannelNotifier

NewChannelNotifier constructs a channel notifier using the provided store.

func (*ChannelNotifier) Close

func (cn *ChannelNotifier) Close() error

Close closes the notifier and all listeners.

func (*ChannelNotifier) NotifyLedgerUpdated

func (cn *ChannelNotifier) NotifyLedgerUpdated(info query.LedgerChannelInfo) error

NotifyLedgerUpdated notifies all listeners of a ledger channel update. It should be called whenever a ledger channel is updated.

func (*ChannelNotifier) NotifyPaymentUpdated

func (cn *ChannelNotifier) NotifyPaymentUpdated(info query.PaymentChannelInfo) error

NotifyPaymentUpdated notifies all listeners of a payment channel update. It should be called whenever a payment channel is updated.

func (*ChannelNotifier) RegisterForAllLedgerUpdates

func (cn *ChannelNotifier) RegisterForAllLedgerUpdates() <-chan query.LedgerChannelInfo

RegisterForAllLedgerUpdates returns a buffered channel that will receive updates for all ledger channels.

func (*ChannelNotifier) RegisterForAllPaymentUpdates

func (cn *ChannelNotifier) RegisterForAllPaymentUpdates() <-chan query.PaymentChannelInfo

RegisterForAllPaymentUpdates returns a buffered channel that will receive updates for all payment channels.

func (*ChannelNotifier) RegisterForLedgerUpdates

func (cn *ChannelNotifier) RegisterForLedgerUpdates(cId types.Destination) <-chan query.LedgerChannelInfo

RegisterForLedgerUpdates returns a buffered channel that will receive updates for a specific ledger channel.

func (*ChannelNotifier) RegisterForPaymentChannelUpdates

func (cn *ChannelNotifier) RegisterForPaymentChannelUpdates(cId types.Destination) <-chan query.PaymentChannelInfo

RegisterForLedgerUpdates returns a buffered channel that will receive updates or a specific payment channel.

Jump to

Keyboard shortcuts

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