Documentation ¶
Overview ¶
Package store implements how to output the log, and how to restore from the log file.
Index ¶
- Constants
- Variables
- type RecordHandler
- type Store
- func (s *Store) ActivateTarget(source, target *url.URL)
- func (s *Store) Close() error
- func (s *Store) CurrentIncidents() []*api.Incident
- func (s *Store) DeactivateTarget(source *url.URL, targets ...*url.URL)
- func (s *Store) Errors() (healthy bool, messages []string)
- func (s *Store) IncidentCount() int
- func (s *Store) IncidentHistory() []*api.Incident
- func (s *Store) MakeReport() api.Report
- func (s *Store) Path() string
- func (s *Store) ProbeHistory() []api.ProbeHistory
- func (s *Store) Report(source *url.URL, r api.Record)
- func (s *Store) ReportInternalError(scope, message string)
- func (s *Store) Restore() error
- func (s *Store) SetPath(p string)
- func (s *Store) Targets() []string
Constants ¶
const ( PROBE_HISTORY_LEN = 40 INCIDENT_HISTORY_LEN = 10 )
Variables ¶
var (
LogRestoreBytes int64 = 100 * 1024 * 1024
)
Functions ¶
This section is empty.
Types ¶
type RecordHandler ¶ added in v0.12.0
type Store ¶
type Store struct { Console io.Writer OnStatusChanged []RecordHandler // contains filtered or unexported fields }
Store is the log handler of Ayd, and it also the database of Ayd.
func (*Store) ActivateTarget ¶ added in v0.12.0
ActivateTarget marks the target will reported via specified source. This method prepares a probeHistory, and mark it as active.
func (*Store) CurrentIncidents ¶
func (*Store) DeactivateTarget ¶ added in v0.12.0
DeactivateTarget marks the target is no longer reported via specified source.
func (*Store) IncidentCount ¶
IncidentCount returns the count of incident causes.
func (*Store) IncidentHistory ¶
func (*Store) MakeReport ¶
MakeReport creates ayd.Report for exporting for endpoint. The result includes only information about active targets.
func (*Store) ProbeHistory ¶
func (s *Store) ProbeHistory() []api.ProbeHistory
ProbeHistory returns a slice of lib-ayd.ProbeHistory. This method only returns active target's ProbeHistory.
func (*Store) Report ¶
Report reports a Record to this Store.
See also probeHistoryMap.Append about the arguments.