Documentation ¶
Index ¶
- Constants
- func EscapeMessage(s string) string
- func UnescapeMessage(s string) string
- type Incident
- type IncidentHandler
- type ProbeHistory
- type ProbeHistoryMap
- type Record
- type Status
- type Store
- func (s *Store) AddTarget(target *url.URL)
- func (s *Store) Close() error
- func (s *Store) CurrentIncidents() []*Incident
- func (s *Store) Err() error
- func (s *Store) IncidentHistory() []*Incident
- func (s *Store) ProbeHistory() []*ProbeHistory
- func (s *Store) Report(r Record)
- func (s *Store) Restore() error
Constants ¶
View Source
const ( PROBE_HISTORY_LEN = 40 INCIDENT_HISTORY_LEN = 10 LOG_RESTORE_BYTES = 1024 * 1024 )
Variables ¶
This section is empty.
Functions ¶
func EscapeMessage ¶ added in v0.3.0
func UnescapeMessage ¶ added in v0.3.0
Types ¶
type Incident ¶
type Incident struct { Target *url.URL Status Status Message string CausedAt time.Time ResolvedAt time.Time }
func NewIncident ¶
func (*Incident) IsContinued ¶
func (*Incident) SameTarget ¶
type IncidentHandler ¶
type IncidentHandler func(*Incident)
type ProbeHistory ¶
type ProbeHistoryMap ¶
type ProbeHistoryMap map[string]*ProbeHistory
func (ProbeHistoryMap) Append ¶ added in v0.3.0
func (hs ProbeHistoryMap) Append(r Record)
type Record ¶
type Record struct { CheckedAt time.Time Target *url.URL Status Status Message string Latency time.Duration }
func ParseRecord ¶
type Store ¶
type Store struct { Path string Console io.Writer OnIncident []IncidentHandler IncidentCount int // contains filtered or unexported fields }
func (*Store) CurrentIncidents ¶
func (*Store) IncidentHistory ¶
func (*Store) ProbeHistory ¶
func (s *Store) ProbeHistory() []*ProbeHistory
Click to show internal directories.
Click to hide internal directories.