Documentation
¶
Index ¶
- func Aggregate(ctx context.Context, s Interface) error
- func AggregateDay(ts time.Time, responses []*types.HttpResponse) *types.HttpResponse
- func GenerateHistory(s Interface, start time.Time, id string) int
- type Bolt
- func (b *Bolt) AddIncident(ctx context.Context, hostID string, e *types.Incident) error
- func (b *Bolt) AddResponse(ctx context.Context, hostID string, r *types.HttpResponse) error
- func (b *Bolt) Close() error
- func (b *Bolt) DeleteIncident(ctx context.Context, hostID string, eventID int) error
- func (b *Bolt) DeleteResponse(ctx context.Context, hostID string, keys []time.Time) error
- func (b *Bolt) EndIncident(ctx context.Context, hostID string, eventID int, ts time.Time) error
- func (b *Bolt) FindIncidents(ctx context.Context, hostID string, skip, limit int) ([]*types.Incident, error)
- func (b *Bolt) FindResponses(ctx context.Context, hostID string) ([]*types.HttpResponse, error)
- func (b *Bolt) Hosts(ctx context.Context) ([]string, error)
- func (b *Bolt) LastResponse(ctx context.Context, hostID string) (*types.HttpResponse, error)
- type Interface
- type Memory
- func (m *Memory) AddIncident(ctx context.Context, hostID string, e *types.Incident) error
- func (m *Memory) AddResponse(ctx context.Context, hostID string, r *types.HttpResponse) error
- func (m *Memory) Close() error
- func (m *Memory) DeleteIncident(ctx context.Context, hostID string, eventID int) error
- func (m *Memory) DeleteResponse(ctx context.Context, hostID string, keys []time.Time) error
- func (m *Memory) EndIncident(ctx context.Context, hostID string, eventID int, ts time.Time) error
- func (m *Memory) FindIncidents(ctx context.Context, hostID string, skip, limit int) ([]*types.Incident, error)
- func (m *Memory) FindResponses(ctx context.Context, hostID string) ([]*types.HttpResponse, error)
- func (m *Memory) Hosts(ctx context.Context) ([]string, error)
- func (m *Memory) LastResponse(ctx context.Context, hostID string) (*types.HttpResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateDay ¶
func AggregateDay(ts time.Time, responses []*types.HttpResponse) *types.HttpResponse
Types ¶
type Bolt ¶
type Bolt struct {
// contains filtered or unexported fields
}
func (*Bolt) AddIncident ¶
func (*Bolt) AddResponse ¶
func (*Bolt) DeleteIncident ¶
func (*Bolt) DeleteResponse ¶
func (*Bolt) EndIncident ¶
func (*Bolt) FindIncidents ¶
func (*Bolt) FindResponses ¶
func (*Bolt) LastResponse ¶
type Interface ¶
type Interface interface {
// AddResponse adds a new response to the history of the given ID.
// DeleteResponse deletes the given keys from the history of the given ID.
// FindResponses returns the history of the given ID.
AddResponse(ctx context.Context, hostID string, r *types.HttpResponse) error
DeleteResponse(ctx context.Context, hostID string, keys []time.Time) error
FindResponses(ctx context.Context, hostID string) ([]*types.HttpResponse, error)
LastResponse(ctx context.Context, hostID string) (*types.HttpResponse, error)
// Hosts returns a list of all hosts that has any responses in the store.
Hosts(ctx context.Context) ([]string, error)
// AddIncident puts a new incident to the store.
// EndIncident marks the incident as finished by setting the end time.
// DeleteIncident removes the incident from the store.
// FindIncidents returns the list of incidents for the ID.
AddIncident(ctx context.Context, hostID string, e *types.Incident) error
EndIncident(ctx context.Context, hostID string, eventID int, ts time.Time) error
DeleteIncident(ctx context.Context, hostID string, eventID int) error
FindIncidents(ctx context.Context, hostID string, skip, limit int) ([]*types.Incident, error)
Close() error
}
type Memory ¶
func (*Memory) AddIncident ¶
func (*Memory) AddResponse ¶
func (*Memory) DeleteIncident ¶
func (*Memory) DeleteResponse ¶
func (*Memory) EndIncident ¶
func (*Memory) FindIncidents ¶
func (*Memory) FindResponses ¶
func (*Memory) LastResponse ¶
Click to show internal directories.
Click to hide internal directories.