Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestClient ¶
func NewTestClient(transport http.RoundTripper) *http.Client
NewTestClient returns *http.Client with Transport replaced to avoid making real calls
Types ¶
type FakeMailer ¶
type FakeMailer struct { Num911Sent int NumEscalationsSent int ArgList911callers []string ArgList911messages []string }
FakeMailer is a mock for the escalation mailer
func (*FakeMailer) DefaultEscalationEmail ¶
func (f *FakeMailer) DefaultEscalationEmail() string
DefaultEscalationEmail returns the email address of the fake emailer
func (*FakeMailer) Send911Email ¶
func (f *FakeMailer) Send911Email(caller string, message string) error
Send911Email records the 911 escalation emails we've sent out
func (*FakeMailer) SendEscalationEmail ¶
func (f *FakeMailer) SendEscalationEmail(alert *common.Alert) error
SendEscalationEmail simply increments an internal counter of how many escalations we've sent
type FakeTransport ¶
type FakeTransport struct { RequestURLs []string // contains filtered or unexported fields }
FakeTransport is a roundtripper that can used with httpclient to write unit tests
func NewFakeTransport ¶
func NewFakeTransport() *FakeTransport
NewFakeTransport creates a faketransport that default returns 200s
func (*FakeTransport) AddHandler ¶
func (f *FakeTransport) AddHandler(url string, handler interface{})
AddHandler installs a handler for a specific url
Click to show internal directories.
Click to hide internal directories.