Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Change alert manager's 'Transit' method to 'Ingress' and update manag…
Browse files Browse the repository at this point in the history
…er_test
  • Loading branch information
richardgreg committed Mar 26, 2024
1 parent 41bc9fb commit b29558c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions internal/alert/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// Manager ... Interface for alert manager
type Manager interface {
AddSession(core.UUID, *core.AlertPolicy) error
Transit() chan core.Alert
Ingress() chan core.Alert

core.Subsystem
}
Expand Down Expand Up @@ -76,9 +76,8 @@ func (am *alertManager) AddSession(id core.UUID, policy *core.AlertPolicy) error
return am.store.AddAlertPolicy(id, policy)
}

// Transit ... Returns inter-subsystem transit channel for receiving alerts
// TODO - Rename this to ingress()
func (am *alertManager) Transit() chan core.Alert {
// Ingress ... Returns inter-subsystem transit channel for receiving alerts
func (am *alertManager) Ingress() chan core.Alert {
return am.alertTransit
}

Expand Down
6 changes: 3 additions & 3 deletions internal/alert/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestEventLoop(t *testing.T) {
_ = am.Shutdown()
}()

ingress := am.Transit()
ingress := am.Ingress()

cm.SetSNSClient(sns)
cm.SetSlackClients([]client.SlackClient{mocks.NewMockSlackClient(c)}, core.LOW)
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestEventLoop(t *testing.T) {
_ = am.Shutdown()
}()

ingress := am.Transit()
ingress := am.Ingress()

cm.SetPagerDutyClients([]client.PagerDutyClient{mocks.NewMockPagerDutyClient(c)}, core.MEDIUM)
cm.SetSNSClient(sns)
Expand Down Expand Up @@ -181,7 +181,7 @@ func TestEventLoop(t *testing.T) {
_ = am.Shutdown()
}()

ingress := am.Transit()
ingress := am.Ingress()

cm.SetSlackClients([]client.SlackClient{mocks.NewMockSlackClient(c), mocks.NewMockSlackClient(c)}, core.HIGH)
cm.SetPagerDutyClients([]client.PagerDutyClient{mocks.NewMockPagerDutyClient(c), mocks.NewMockPagerDutyClient(c)}, core.HIGH)
Expand Down

0 comments on commit b29558c

Please sign in to comment.