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

[WIP]Change alert manager's 'Transit' method to 'Ingress' #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading