Documentation
¶
Index ¶
- type HeartbeatSummary
- type ReceiverStore
- type ReceiverSummary
- type Service
- func (s *Service) HeartbeatSummaries() []HeartbeatSummary
- func (s *Service) HeartbeatSummaryByID(id string) (HeartbeatSummary, bool)
- func (s *Service) HistorySnapshot() []history.Event
- func (s *Service) HistoryStream(buffer int) (<-chan history.Event, func())
- func (s *Service) ReceiverSummaries() []ReceiverSummary
- func (s *Service) ReceiverSummaryByKey(receiver, targetTypeName, target string) (ReceiverSummary, bool)
- func (s *Service) StatusAll() []Status
- func (s *Service) StatusByID(id string) (Status, error)
- func (s *Service) Update(id string, payload string, now time.Time) error
- type Status
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatSummary ¶
type HeartbeatSummary struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Status string `json:"status"`
Interval string `json:"interval,omitempty"`
IntervalSeconds int64 `json:"intervalSeconds,omitempty"`
LateAfter string `json:"lateAfter,omitempty"`
LateAfterSeconds int64 `json:"lateAfterSeconds,omitempty"`
LastBump string `json:"lastBump,omitempty"`
Receivers []string `json:"receivers,omitempty"`
URL string `json:"url,omitempty"`
HasHistory bool `json:"hasHistory,omitempty"`
}
HeartbeatSummary represents a UI-friendly heartbeat payload.
type ReceiverStore ¶
ReceiverStore provides receiver configuration access.
type ReceiverSummary ¶
type ReceiverSummary struct {
ID string `json:"id"`
Type string `json:"type"`
Destination string `json:"destination"`
LastSent string `json:"lastSent,omitempty"`
LastErr string `json:"lastErr,omitempty"`
}
ReceiverSummary represents a UI-friendly receiver payload.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(manager Store, receivers ReceiverStore, historyStore history.Recorder, metricsReg *metrics.Registry) *Service
NewService constructs a Service from a Manager.
func (*Service) HeartbeatSummaries ¶
func (s *Service) HeartbeatSummaries() []HeartbeatSummary
HeartbeatSummaries returns a summary list for the UI.
func (*Service) HeartbeatSummaryByID ¶
func (s *Service) HeartbeatSummaryByID(id string) (HeartbeatSummary, bool)
HeartbeatSummaryByID returns a heartbeat summary for a given id.
func (*Service) HistorySnapshot ¶
HistorySnapshot returns all history events.
func (*Service) HistoryStream ¶
HistoryStream subscribes to history events when supported.
func (*Service) ReceiverSummaries ¶
func (s *Service) ReceiverSummaries() []ReceiverSummary
ReceiverSummaries returns a summary list for the UI.
func (*Service) ReceiverSummaryByKey ¶
func (s *Service) ReceiverSummaryByKey(receiver, targetTypeName, target string) (ReceiverSummary, bool)
ReceiverSummaryByKey returns a receiver summary by receiver/type/target.
func (*Service) StatusByID ¶
StatusByID returns the status for a heartbeat.
type Status ¶
type Status struct {
ID string `json:"id"` // Heartbeat identifier.
LastSeen time.Time `json:"last_seen"` // Last received heartbeat time.
Stage runner.Stage `json:"stage"` // Current stage.
LateAfter time.Duration `json:"lateAfter"` // Late window duration.
Interval time.Duration `json:"interval"` // Expected interval.
SinceSeen time.Duration `json:"since_last_seen"` // Time since last heartbeat.
}
Status is the public heartbeat state payload.