Skip to content

Commit f21d970

Browse files
committed
Tinker with naming
1 parent 7d1c606 commit f21d970

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

internal/notification/aggregate.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

internal/notification/multi.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package notification
2+
3+
import "context"
4+
5+
type MultiNotifier struct {
6+
notifiers []Notifier
7+
}
8+
9+
func NewMultiNotifier(notifiers []Notifier) *MultiNotifier {
10+
return &MultiNotifier{
11+
notifiers: notifiers,
12+
}
13+
}
14+
15+
func (an *MultiNotifier) Notify(ctx context.Context, notif Notification) error {
16+
for _, n := range an.notifiers {
17+
if err := n.Notify(ctx, notif); err != nil {
18+
return err
19+
}
20+
}
21+
return nil
22+
}

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func run(ctx context.Context) error {
6868
conf.GKEClusterName,
6969
k8sClient,
7070
store,
71-
notification.NewAggregateNotifier(notifiers),
71+
notification.NewMultiNotifier(notifiers),
7272
)
7373

7474
return watcher.Watch(ctx)

0 commit comments

Comments
 (0)