Skip to content

Commit d8586e7

Browse files
committed
Fixing function documentation
1 parent 5adb143 commit d8586e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

notifications/notifier.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ type typeNotifier interface {
1010
SendNotification()
1111
}
1212

13+
// Notifier can send log output as notification to admins, with optional batching.
1314
type Notifier struct {
1415
types []typeNotifier
1516
}
1617

18+
// NewNotifier creates and returns a new Notifier, using global configuration.
1719
func NewNotifier(c *cli.Context) *Notifier {
1820
n := &Notifier{}
1921

@@ -33,12 +35,14 @@ func NewNotifier(c *cli.Context) *Notifier {
3335
return n
3436
}
3537

38+
// StartNotification starts a log batch. Notifications will be accumulated after this point and only sent when SendNotification() is called.
3639
func (n *Notifier) StartNotification() {
3740
for _, t := range n.types {
3841
t.StartNotification()
3942
}
4043
}
4144

45+
// SendNotification sends any notifications accumulated since StartNotification() was called.
4246
func (n *Notifier) SendNotification() {
4347
for _, t := range n.types {
4448
t.SendNotification()

0 commit comments

Comments
 (0)