type AlertStatus … const AlertFiring … const AlertResolved … type Alert … // Name returns the name of the alert. It is equivalent to the "alertname" label. func (a *Alert) Name() string { … } // Fingerprint returns a unique hash for the alert. It is equivalent to // the fingerprint of the alert's label set. func (a *Alert) Fingerprint() Fingerprint { … } func (a *Alert) String() string { … } // Resolved returns true iff the activity interval ended in the past. func (a *Alert) Resolved() bool { … } // ResolvedAt returns true off the activity interval ended before // the given timestamp. func (a *Alert) ResolvedAt(ts time.Time) bool { … } // Status returns the status of the alert. func (a *Alert) Status() AlertStatus { … } // StatusAt returns the status of the alert at the given timestamp. func (a *Alert) StatusAt(ts time.Time) AlertStatus { … } // Validate checks whether the alert data is inconsistent. func (a *Alert) Validate() error { … } type Alerts … func (as Alerts) Len() int { … } func (as Alerts) Swap(i, j int) { … } func (as Alerts) Less(i, j int) bool { … } // HasFiring returns true iff one of the alerts is not resolved. func (as Alerts) HasFiring() bool { … } // HasFiringAt returns true iff one of the alerts is not resolved // at the time ts. func (as Alerts) HasFiringAt(ts time.Time) bool { … } // Status returns StatusFiring iff at least one of the alerts is firing. func (as Alerts) Status() AlertStatus { … } // StatusAt returns StatusFiring iff at least one of the alerts is firing // at the time ts. func (as Alerts) StatusAt(ts time.Time) AlertStatus { … }