Files
gatus/config/endpoint/status.go
T

38 lines
983 B
Go
Raw Normal View History

package endpoint
2021-10-23 16:47:12 -04:00
// Status contains the evaluation Results of an Endpoint
type Status struct {
2021-10-23 16:47:12 -04:00
// Name of the endpoint
Name string `json:"name,omitempty"`
// Group the endpoint is a part of. Used for grouping multiple endpoints together on the front end.
Group string `json:"group,omitempty"`
// Key of the Endpoint
2021-10-23 16:47:12 -04:00
Key string `json:"key"`
// Results is the list of endpoint evaluation results
Results []*Result `json:"results"`
// Events is a list of events
Events []*Event `json:"events,omitempty"`
2021-10-23 16:47:12 -04:00
// Uptime information on the endpoint's uptime
//
// Used by the memory store.
//
// To retrieve the uptime between two time, use store.GetUptimeByKey.
Uptime *Uptime `json:"-"`
}
// NewStatus creates a new Status
func NewStatus(group, name string) *Status {
return &Status{
2021-10-23 16:47:12 -04:00
Name: name,
Group: group,
Key: ConvertGroupAndEndpointNameToKey(group, name),
2021-10-23 16:47:12 -04:00
Results: make([]*Result, 0),
Events: make([]*Event, 0),
Uptime: NewUptime(),
}
}