Documentation ¶
Overview ¶
Package alerts manages alert values in the database.
Index ¶
Constants ¶
View Source
const ( // StatusIDExpression is a partial regular expression that validates status identifiers. // For now this is quite loose to handle Sheriff-o-matic keys which contain builder name // strings, so could be any characters at all. // Example SOM key: chromium$!chrome$!ci$!linux-chromeos-chrome$!browser_tests on Ubuntu-22.04$!8754809345790718177 // TODO: Once we switch away from sheriff-o-matic we should tighten this up. AlertKeyExpression = `[^/]+` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alert ¶
type Alert struct { // The key of the alert. // For now, this matches the key of the alert in Sheriff-o-Matic. // This may be revised in the future. AlertKey string // The bug number in Buganizer/IssueTracker. // 0 if the alert is not linked to a bug. Bug int64 // GerritCL is the CL number associated with this alert. // 0 means the alert is not associated with any GerritCL. GerritCL int64 // The build number to consider this alert silenced until. // 0 if the alert is not silenced. SilenceUntil int64 // The time the alert was last modified. // Used to control TTL of alert values. ModifyTime time.Time }
Alert mirrors the structure of alert values in the database.
func ReadBatch ¶
ReadBatch retrieves a batch of alerts from the database. If no record exists for an alert in the database an alert struct with all fields other than the key set to zero values will be returned. Returned alerts are in the same order as the keys requested. At most 100 keys can be requested in a batch.
Click to show internal directories.
Click to hide internal directories.