Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Monitor ¶
func Monitor(resources []config.Resource) <-chan *StateChangeMessage
Monitor takes a resource and polls the given HTTP url for errors , and emits failure / recovery messages accordingly
Types ¶
type StateChangeMessage ¶
type StateChangeMessage struct { Resource config.Resource IsOk bool Codes []int Datetime time.Time }
StateChangeMessage represents either a failure or a recovery
func ErrorMessage ¶
func ErrorMessage(resource config.Resource, codes []int) *StateChangeMessage
ErrorMessage initializes a message with Time.Now() as the creation date and IsOk = false
func RecoveryMessage ¶
func RecoveryMessage(resource config.Resource, codes []int) *StateChangeMessage
NewMessage initializes a message with Time.Now() as the creation date and IsOk = true
func (*StateChangeMessage) MailBody ¶
func (m *StateChangeMessage) MailBody() string
func (*StateChangeMessage) MailSubject ¶
func (m *StateChangeMessage) MailSubject() string
func (*StateChangeMessage) String ¶
func (m *StateChangeMessage) String() string
Click to show internal directories.
Click to hide internal directories.