Skip to content

Commit

Permalink
Tinker with naming
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-jones committed Jul 15, 2024
1 parent 7d1c606 commit f21d970
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
22 changes: 0 additions & 22 deletions internal/notification/aggregate.go

This file was deleted.

22 changes: 22 additions & 0 deletions internal/notification/multi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package notification

import "context"

type MultiNotifier struct {
notifiers []Notifier
}

func NewMultiNotifier(notifiers []Notifier) *MultiNotifier {
return &MultiNotifier{
notifiers: notifiers,
}
}

func (an *MultiNotifier) Notify(ctx context.Context, notif Notification) error {
for _, n := range an.notifiers {
if err := n.Notify(ctx, notif); err != nil {
return err
}
}
return nil
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func run(ctx context.Context) error {
conf.GKEClusterName,
k8sClient,
store,
notification.NewAggregateNotifier(notifiers),
notification.NewMultiNotifier(notifiers),
)

return watcher.Watch(ctx)
Expand Down

0 comments on commit f21d970

Please sign in to comment.