store

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROBE_HISTORY_LEN    = 40
	INCIDENT_HISTORY_LEN = 10
)

Variables

View Source
var (
	LogRestoreBytes int64 = 100 * 1024 * 1024
)

Functions

func CompareRecords added in v0.5.0

func CompareRecords(x, y api.Record) bool

func IncidentIsContinued added in v0.5.0

func IncidentIsContinued(i *api.Incident, r api.Record) bool

func NewIncident

func NewIncident(r api.Record) *api.Incident

Types

type IncidentHandler

type IncidentHandler func(*api.Incident)

type ProbeHistory

type ProbeHistory struct {
	Target  *url.URL
	Records []api.Record
}

type ProbeHistoryMap

type ProbeHistoryMap map[string]*ProbeHistory

func (ProbeHistoryMap) Append added in v0.3.0

func (hs ProbeHistoryMap) Append(r api.Record)

type Store

type Store struct {
	Path string

	Console io.Writer

	OnIncident    []IncidentHandler
	IncidentCount int
	// contains filtered or unexported fields
}

func New

func New(path string) (*Store, error)

func (*Store) AddTarget

func (s *Store) AddTarget(target *url.URL)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CurrentIncidents

func (s *Store) CurrentIncidents() []*api.Incident

func (*Store) Err

func (s *Store) Err() error

func (*Store) Freeze added in v0.5.0

func (s *Store) Freeze() freeze.Status

func (*Store) IncidentHistory

func (s *Store) IncidentHistory() []*api.Incident

func (*Store) ProbeHistory

func (s *Store) ProbeHistory() []*ProbeHistory

func (*Store) Report added in v0.4.0

func (s *Store) Report(r api.Record)

func (*Store) ReportInternalError added in v0.9.0

func (s *Store) ReportInternalError(scope, message string)

func (*Store) Restore

func (s *Store) Restore() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL