mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
Fixing function documentation
This commit is contained in:
parent
5adb143f62
commit
d8586e79ca
1 changed files with 4 additions and 0 deletions
|
@ -10,10 +10,12 @@ type typeNotifier interface {
|
||||||
SendNotification()
|
SendNotification()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notifier can send log output as notification to admins, with optional batching.
|
||||||
type Notifier struct {
|
type Notifier struct {
|
||||||
types []typeNotifier
|
types []typeNotifier
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewNotifier creates and returns a new Notifier, using global configuration.
|
||||||
func NewNotifier(c *cli.Context) *Notifier {
|
func NewNotifier(c *cli.Context) *Notifier {
|
||||||
n := &Notifier{}
|
n := &Notifier{}
|
||||||
|
|
||||||
|
@ -33,12 +35,14 @@ func NewNotifier(c *cli.Context) *Notifier {
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartNotification starts a log batch. Notifications will be accumulated after this point and only sent when SendNotification() is called.
|
||||||
func (n *Notifier) StartNotification() {
|
func (n *Notifier) StartNotification() {
|
||||||
for _, t := range n.types {
|
for _, t := range n.types {
|
||||||
t.StartNotification()
|
t.StartNotification()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SendNotification sends any notifications accumulated since StartNotification() was called.
|
||||||
func (n *Notifier) SendNotification() {
|
func (n *Notifier) SendNotification() {
|
||||||
for _, t := range n.types {
|
for _, t := range n.types {
|
||||||
t.SendNotification()
|
t.SendNotification()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue