2019-03-26 09:06:32 +00:00
|
|
|
package events
|
|
|
|
|
2019-03-27 08:58:34 +00:00
|
|
|
const (
|
2019-04-15 11:34:29 +00:00
|
|
|
BlockReceived = "block.received"
|
|
|
|
ChannelActive = "channel.active"
|
|
|
|
ChannelBalanceUpdated = "channel.balance.updated"
|
2019-05-14 16:13:59 +00:00
|
|
|
ChannelInactive = "channel.inactive"
|
|
|
|
ChannelPending = "channel.pending"
|
|
|
|
InvoiceCreated = "invoice.created"
|
|
|
|
InvoiceSettled = "invoice.settled"
|
|
|
|
PeerUpdated = "peer.updated"
|
|
|
|
TransactionCreated = "transaction.created"
|
2019-04-15 11:34:29 +00:00
|
|
|
WalletBalanceUpdated = "wallet.balance.updated"
|
2021-05-09 21:37:01 +00:00
|
|
|
RoutingEventUpdated = "routing.event.updated"
|
2019-03-27 08:58:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Event struct {
|
|
|
|
Type string
|
|
|
|
ID string
|
2021-05-09 21:37:01 +00:00
|
|
|
Data interface{}
|
2019-03-27 08:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(kind string) *Event {
|
|
|
|
return &Event{Type: kind}
|
|
|
|
}
|
2021-05-09 21:37:01 +00:00
|
|
|
|
|
|
|
func NewWithData(kind string, data interface{}) *Event {
|
|
|
|
return &Event{Type: kind, Data: data}
|
|
|
|
}
|