this repo has no description
1package notify
2
3import (
4 "context"
5
6 "tangled.sh/tangled.sh/core/appview/db"
7)
8
9type mergedNotifier struct {
10 notifiers []Notifier
11}
12
13func NewMergedNotifier(notifiers ...Notifier) Notifier {
14 return &mergedNotifier{
15 notifiers,
16 }
17}
18
19var _ Notifier = &mergedNotifier{}
20
21func (m *mergedNotifier) NewIssue(ctx context.Context, issue *db.Issue) {
22 for _, notifier := range m.notifiers {
23 notifier.NewIssue(ctx, issue)
24 }
25}
26
27func (m *mergedNotifier) NewIssueComment(ctx context.Context, comment db.Comment) {
28 for _, notifier := range m.notifiers {
29 notifier.NewIssueComment(ctx, comment)
30 }
31}
32
33func (m *mergedNotifier) NewPullComment(ctx context.Context, comment db.PullComment) {
34 for _, notifier := range m.notifiers {
35 notifier.NewPullComment(ctx, comment)
36 }
37}