Documentation ¶
Index ¶
- Variables
- func Conclude(serviceID uuid.UUID, startTime, endTime time.Time) (err error)
- func Create(incident *Incident) (err error)
- func DateFromTime(ts time.Time) time.Time
- func New(previous, current health.ServiceStatus, service *services.Service) (err error)
- func NewRelativeStatusChange(previous, current health.ServiceStatus, service *services.Service) (err error)
- func NewStatusChange(previous, current health.ServiceStatus, service *services.Service) (err error)
- func NewVersionChange(previous, current health.ServiceStatus, service *services.Service) (err error)
- func NewVersionDetected(current health.ServiceStatus, service *services.Service) (err error)
- func NotADate(t time.Time) bool
- func Today() time.Time
- func Update(serviceID uuid.UUID, startTime time.Time, update func(*Incident) error) (err error)
- type Group
- type Incident
Constants ¶
This section is empty.
Variables ¶
View Source
var Prefix = []byte{0, 105, 110, 99, 105, 100, 101, 110, 116, 32, 104, 105, 115, 116, 111, 114, 121}
Functions ¶
func Conclude ¶
Find the incident with the specified serviceID and startTime and update its endTime.
func New ¶
func New(previous, current health.ServiceStatus, service *services.Service) (err error)
New creates an incident based on the previous and current statuses.
func NewRelativeStatusChange ¶
func NewRelativeStatusChange(previous, current health.ServiceStatus, service *services.Service) (err error)
func NewStatusChange ¶
func NewStatusChange(previous, current health.ServiceStatus, service *services.Service) (err error)
func NewVersionChange ¶
func NewVersionChange(previous, current health.ServiceStatus, service *services.Service) (err error)
func NewVersionDetected ¶
func NewVersionDetected(current health.ServiceStatus, service *services.Service) (err error)
Types ¶
type Group ¶
Incidents are grouped by day and stored together in the database to make it easier to fetch incidents for a specific date rather than have to serialize each incident individually. To update an incident group ensure a transaction is used.
func LastWeek ¶
Returns the last week's worth of incidents or an empty incident group if none exists.
type Incident ¶
type Incident struct { ServiceID uuid.UUID `msgpack:"service_id"` ServiceName string `msgpack:"service_name"` Description string `msgpack:"description"` StartTime time.Time `msgpack:"start_time"` EndTime time.Time `msgpack:"end_time"` Status health.Status `msgpack:"status"` PreviousStatus health.Status `msgpack:"previous_status"` }
func (*Incident) DescriptionFromStatus ¶
Click to show internal directories.
Click to hide internal directories.