@@ -25,12 +25,14 @@ import (
25
25
type NotifyOutput struct {
26
26
errorChan chan error
27
27
eventChan chan event.Event
28
+ title string
28
29
}
29
30
30
31
func New (options ... NotifyOptionFunc ) * NotifyOutput {
31
32
n := & NotifyOutput {
32
33
errorChan : make (chan error ),
33
34
eventChan : make (chan event.Event , 10 ),
35
+ title : "Snek" ,
34
36
}
35
37
for _ , option := range options {
36
38
option (n )
@@ -56,7 +58,7 @@ func (n *NotifyOutput) Start() error {
56
58
57
59
be := payload .(chainsync.BlockEvent )
58
60
err := beeep .Notify (
59
- "Snek" ,
61
+ n . title ,
60
62
fmt .Sprintf ("New Block!\n BlockNumber: %d, SlotNumber: %d\n Hash: %s" ,
61
63
be .BlockNumber ,
62
64
be .SlotNumber ,
@@ -75,7 +77,7 @@ func (n *NotifyOutput) Start() error {
75
77
76
78
re := payload .(chainsync.RollbackEvent )
77
79
err := beeep .Notify (
78
- "Snek" ,
80
+ n . title ,
79
81
fmt .Sprintf ("Rollback!\n SlotNumber: %d\n BlockHash: %s" ,
80
82
re .SlotNumber ,
81
83
re .BlockHash ,
@@ -93,7 +95,7 @@ func (n *NotifyOutput) Start() error {
93
95
94
96
te := payload .(chainsync.TransactionEvent )
95
97
err := beeep .Notify (
96
- "Snek" ,
98
+ n . title ,
97
99
fmt .Sprintf ("New Transaction!\n BlockNumber: %d, SlotNumber: %d\n Inputs: %d, Outputs: %d\n Hash: %s" ,
98
100
te .BlockNumber ,
99
101
te .SlotNumber ,
@@ -108,7 +110,7 @@ func (n *NotifyOutput) Start() error {
108
110
}
109
111
default :
110
112
err := beeep .Notify (
111
- "Snek" ,
113
+ n . title ,
112
114
fmt .Sprintf ("New Event!\n Event: %v" , evt ),
113
115
"assets/snek-icon.png" ,
114
116
)
0 commit comments