Documentation
¶
Index ¶
- type CountGroupsParams
- type CountGroupsRow
- type CountOpenGroupsByIntegrationParams
- type CountOpenGroupsByIntegrationRow
- type CountOpenGroupsByRouteRow
- type DBTX
- type DeleteExpiredGroupsParams
- type DeleteExpiredMembershipsParams
- type DeleteTimerParams
- type FindOpenGroupParams
- type FindReopenableGroupParams
- type GetGroupIDParams
- type GetGroupIDRow
- type GetGroupKeyParams
- type GetGroupKeyRow
- type GetGroupParams
- type GetGroupRefParams
- type GetGroupRefRow
- type GetGroupRow
- type GetGroupTimerParams
- type GetGroupingSettingsRow
- type GetLastReminderSeqParams
- type GetListSettingsRow
- type GetRetentionPeriodsRow
- type GetRoutePolicyParams
- type GetRoutePolicyRow
- type GetSnapshotReceivedAtParams
- type GetTimerPolicyParams
- type GetTimerPolicyRow
- type GetUserTimeZoneParams
- type InsertDowntimeEntriesParams
- type InsertGroupParams
- type InsertMembershipsParams
- type InsertNoteParams
- type InsertTimelineEntryParams
- type IntegrationStatisticsParams
- type IntegrationStatisticsRow
- type IsActiveUserParams
- type ListAlertGroupKeysParams
- type ListAlertGroupKeysRow
- type ListChangedAlertsParams
- type ListChangedAlertsRow
- type ListFiringMembershipsParams
- type ListFiringMembershipsRow
- type ListGroupAlertsParams
- type ListGroupAlertsRow
- type ListGroupFiringAlertsParams
- type ListGroupFiringAlertsRow
- type ListGroupsChangedAscParams
- type ListGroupsChangedAscRow
- type ListGroupsChangedDescParams
- type ListGroupsChangedDescRow
- type ListGroupsStartedAscParams
- type ListGroupsStartedAscRow
- type ListGroupsStartedDescParams
- type ListGroupsStartedDescRow
- type ListIntegrationRefsParams
- type ListIntegrationRefsRow
- type ListIntegrationsByPublicIDParams
- type ListIntegrationsByPublicIDRow
- type ListJoinedDuringSnoozeParams
- type ListOpenGroupsOfRouteParams
- type ListOwnedGroupsParams
- type ListRelatedGroupsParams
- type ListRelatedGroupsRow
- type ListRoutesByPublicIDParams
- type ListRoutesByPublicIDRow
- type ListServiceAccountRefsParams
- type ListServiceAccountRefsRow
- type ListStatisticsIntegrationsParams
- type ListStatisticsIntegrationsRow
- type ListStatisticsRoutesParams
- type ListStatisticsRoutesRow
- type ListTimelineAscParams
- type ListTimelineAscRow
- type ListTimelineDeliveryEventsParams
- type ListTimelineDeliveryEventsRow
- type ListTimelineDescParams
- type ListTimelineDescRow
- type ListTimelineNotesParams
- type ListTimelineNotesRow
- type ListUserRefsParams
- type ListUserRefsRow
- type ListUsersByPublicIDParams
- type ListUsersByPublicIDRow
- type LockActiveUserParams
- type LockDefaultRouteRow
- type LockGroupsParams
- type LockGroupsRow
- type LockRouteForMoveParams
- type LockRouteForMoveRow
- type LockRoutesParams
- type LockRoutesRow
- type MoveMembershipsParams
- type PeekGroupParams
- type PeekGroupRow
- type Queries
- func (q *Queries) CountGroups(ctx context.Context, arg CountGroupsParams) ([]CountGroupsRow, error)
- func (q *Queries) CountOpenGroupsByIntegration(ctx context.Context, arg CountOpenGroupsByIntegrationParams) ([]CountOpenGroupsByIntegrationRow, error)
- func (q *Queries) CountOpenGroupsByRoute(ctx context.Context, orgID int64) ([]CountOpenGroupsByRouteRow, error)
- func (q *Queries) DeleteExpiredGroups(ctx context.Context, arg DeleteExpiredGroupsParams) (int64, error)
- func (q *Queries) DeleteExpiredMemberships(ctx context.Context, arg DeleteExpiredMembershipsParams) (int64, error)
- func (q *Queries) DeleteTimer(ctx context.Context, arg DeleteTimerParams) error
- func (q *Queries) EnsureCounter(ctx context.Context, orgID int64) error
- func (q *Queries) FindOpenGroup(ctx context.Context, arg FindOpenGroupParams) (int64, error)
- func (q *Queries) FindReopenableGroup(ctx context.Context, arg FindReopenableGroupParams) (int64, error)
- func (q *Queries) GetDefaultRouteID(ctx context.Context, orgID int64) (int64, error)
- func (q *Queries) GetGroup(ctx context.Context, arg GetGroupParams) (GetGroupRow, error)
- func (q *Queries) GetGroupID(ctx context.Context, arg GetGroupIDParams) (GetGroupIDRow, error)
- func (q *Queries) GetGroupKey(ctx context.Context, arg GetGroupKeyParams) (GetGroupKeyRow, error)
- func (q *Queries) GetGroupRef(ctx context.Context, arg GetGroupRefParams) (GetGroupRefRow, error)
- func (q *Queries) GetGroupTimer(ctx context.Context, arg GetGroupTimerParams) (time.Time, error)
- func (q *Queries) GetGroupingSettings(ctx context.Context, orgID int64) (GetGroupingSettingsRow, error)
- func (q *Queries) GetLastReminderSeq(ctx context.Context, arg GetLastReminderSeqParams) (int64, error)
- func (q *Queries) GetListSettings(ctx context.Context, orgID int64) (GetListSettingsRow, error)
- func (q *Queries) GetRetentionPeriods(ctx context.Context, orgID int64) (GetRetentionPeriodsRow, error)
- func (q *Queries) GetRoutePolicy(ctx context.Context, arg GetRoutePolicyParams) (GetRoutePolicyRow, error)
- func (q *Queries) GetSnapshotReceivedAt(ctx context.Context, arg GetSnapshotReceivedAtParams) (time.Time, error)
- func (q *Queries) GetTimerPolicy(ctx context.Context, arg GetTimerPolicyParams) (GetTimerPolicyRow, error)
- func (q *Queries) GetUserTimeZone(ctx context.Context, arg GetUserTimeZoneParams) (string, error)
- func (q *Queries) InsertDowntimeEntries(ctx context.Context, arg InsertDowntimeEntriesParams) error
- func (q *Queries) InsertGroup(ctx context.Context, arg InsertGroupParams) (int64, error)
- func (q *Queries) InsertMemberships(ctx context.Context, arg InsertMembershipsParams) error
- func (q *Queries) InsertNote(ctx context.Context, arg InsertNoteParams) error
- func (q *Queries) InsertTimelineEntry(ctx context.Context, arg InsertTimelineEntryParams) error
- func (q *Queries) IntegrationStatistics(ctx context.Context, arg IntegrationStatisticsParams) ([]IntegrationStatisticsRow, error)
- func (q *Queries) IsActiveUser(ctx context.Context, arg IsActiveUserParams) (bool, error)
- func (q *Queries) ListAlertGroupKeys(ctx context.Context, arg ListAlertGroupKeysParams) ([]ListAlertGroupKeysRow, error)
- func (q *Queries) ListChangedAlerts(ctx context.Context, arg ListChangedAlertsParams) ([]ListChangedAlertsRow, error)
- func (q *Queries) ListFiringMemberships(ctx context.Context, arg ListFiringMembershipsParams) ([]ListFiringMembershipsRow, error)
- func (q *Queries) ListGroupAlerts(ctx context.Context, arg ListGroupAlertsParams) ([]ListGroupAlertsRow, error)
- func (q *Queries) ListGroupFiringAlerts(ctx context.Context, arg ListGroupFiringAlertsParams) ([]ListGroupFiringAlertsRow, error)
- func (q *Queries) ListGroupsChangedAsc(ctx context.Context, arg ListGroupsChangedAscParams) ([]ListGroupsChangedAscRow, error)
- func (q *Queries) ListGroupsChangedDesc(ctx context.Context, arg ListGroupsChangedDescParams) ([]ListGroupsChangedDescRow, error)
- func (q *Queries) ListGroupsStartedAsc(ctx context.Context, arg ListGroupsStartedAscParams) ([]ListGroupsStartedAscRow, error)
- func (q *Queries) ListGroupsStartedDesc(ctx context.Context, arg ListGroupsStartedDescParams) ([]ListGroupsStartedDescRow, error)
- func (q *Queries) ListIntegrationRefs(ctx context.Context, arg ListIntegrationRefsParams) ([]ListIntegrationRefsRow, error)
- func (q *Queries) ListIntegrationsByPublicID(ctx context.Context, arg ListIntegrationsByPublicIDParams) ([]ListIntegrationsByPublicIDRow, error)
- func (q *Queries) ListJoinedDuringSnooze(ctx context.Context, arg ListJoinedDuringSnoozeParams) ([]string, error)
- func (q *Queries) ListOpenGroupIDs(ctx context.Context, orgID int64) ([]int64, error)
- func (q *Queries) ListOpenGroupsOfRoute(ctx context.Context, arg ListOpenGroupsOfRouteParams) ([]int64, error)
- func (q *Queries) ListOwnedGroups(ctx context.Context, arg ListOwnedGroupsParams) ([]int64, error)
- func (q *Queries) ListRelatedGroups(ctx context.Context, arg ListRelatedGroupsParams) ([]ListRelatedGroupsRow, error)
- func (q *Queries) ListRoutePublicIDs(ctx context.Context, orgID int64) ([]string, error)
- func (q *Queries) ListRoutesByPublicID(ctx context.Context, arg ListRoutesByPublicIDParams) ([]ListRoutesByPublicIDRow, error)
- func (q *Queries) ListServiceAccountRefs(ctx context.Context, arg ListServiceAccountRefsParams) ([]ListServiceAccountRefsRow, error)
- func (q *Queries) ListStatisticsIntegrations(ctx context.Context, arg ListStatisticsIntegrationsParams) ([]ListStatisticsIntegrationsRow, error)
- func (q *Queries) ListStatisticsRoutes(ctx context.Context, arg ListStatisticsRoutesParams) ([]ListStatisticsRoutesRow, error)
- func (q *Queries) ListTimelineAsc(ctx context.Context, arg ListTimelineAscParams) ([]ListTimelineAscRow, error)
- func (q *Queries) ListTimelineDeliveryEvents(ctx context.Context, arg ListTimelineDeliveryEventsParams) ([]ListTimelineDeliveryEventsRow, error)
- func (q *Queries) ListTimelineDesc(ctx context.Context, arg ListTimelineDescParams) ([]ListTimelineDescRow, error)
- func (q *Queries) ListTimelineNotes(ctx context.Context, arg ListTimelineNotesParams) ([]ListTimelineNotesRow, error)
- func (q *Queries) ListUserRefs(ctx context.Context, arg ListUserRefsParams) ([]ListUserRefsRow, error)
- func (q *Queries) ListUsersByPublicID(ctx context.Context, arg ListUsersByPublicIDParams) ([]ListUsersByPublicIDRow, error)
- func (q *Queries) LockActiveUser(ctx context.Context, arg LockActiveUserParams) ([]int64, error)
- func (q *Queries) LockCounter(ctx context.Context, orgID int64) (int64, error)
- func (q *Queries) LockDefaultRoute(ctx context.Context, orgID int64) (LockDefaultRouteRow, error)
- func (q *Queries) LockGroups(ctx context.Context, arg LockGroupsParams) ([]LockGroupsRow, error)
- func (q *Queries) LockRouteForMove(ctx context.Context, arg LockRouteForMoveParams) (LockRouteForMoveRow, error)
- func (q *Queries) LockRoutes(ctx context.Context, arg LockRoutesParams) ([]LockRoutesRow, error)
- func (q *Queries) MoveMemberships(ctx context.Context, arg MoveMembershipsParams) error
- func (q *Queries) NextNumber(ctx context.Context, orgID int64) (int64, error)
- func (q *Queries) NotifyTimers(ctx context.Context, channel string) error
- func (q *Queries) PeekGroup(ctx context.Context, arg PeekGroupParams) (PeekGroupRow, error)
- func (q *Queries) ResolveMemberships(ctx context.Context, arg ResolveMembershipsParams) error
- func (q *Queries) RollbackGrouping(ctx context.Context) error
- func (q *Queries) RouteStatistics(ctx context.Context, arg RouteStatisticsParams) ([]RouteStatisticsRow, error)
- func (q *Queries) SaveGroup(ctx context.Context, arg SaveGroupParams) error
- func (q *Queries) SavepointGrouping(ctx context.Context) error
- func (q *Queries) UpdateMemberships(ctx context.Context, arg UpdateMembershipsParams) error
- func (q *Queries) UpsertTimer(ctx context.Context, arg UpsertTimerParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResolveMembershipsParams
- type RouteStatisticsParams
- type RouteStatisticsRow
- type SaveGroupParams
- type UpdateMembershipsParams
- type UpsertTimerParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountGroupsParams ¶
type CountGroupsParams struct {
WithLabels bool
OrgID int64
Number pgtype.Int8
RangeTo time.Time
RangeFrom time.Time
RouteIds []int64
IntegrationIds []int64
Severities []string
Urgent pgtype.Bool
ResolvedBy pgtype.Text
ResolveReason pgtype.Text
Reopened pgtype.Bool
OwnerSet bool
OwnerID pgtype.Int8
SnoozedNoEnd pgtype.Bool
DeliveryProblem pgtype.Bool
Unclaimed pgtype.Bool
Contains []byte
Pattern pgtype.Text
}
type CountGroupsRow ¶
type DeleteTimerParams ¶
type FindOpenGroupParams ¶
type GetGroupIDParams ¶
type GetGroupIDRow ¶
type GetGroupIDRow struct {
ID int64
ResolvedAt pgtype.Timestamptz
RetentionAlertDetailsDays int64
}
type GetGroupKeyParams ¶
type GetGroupKeyRow ¶
type GetGroupParams ¶
type GetGroupRefParams ¶
type GetGroupRefRow ¶
type GetGroupRow ¶
type GetGroupRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
GroupKeyValues []byte
CommonLabels []byte
CommonAnnotations []byte
IntegrationIds []int64
ReopenCount int64
FiringAlertCount int64
ResolvedAlertCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
CreatedAt time.Time
LastChangedAt time.Time
RoutePublicID string
RouteName string
FiringAgainAfterNumber int64
ReplacedLabel string
StillFiring int64
RetentionAlertDetailsDays int64
OwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
NewerPublicID string
NewerNumber int64
RouteDeleted bool
DeliveryProblem bool
Unclaimed bool
NextNoticeKind string
NextNoticeAt time.Time
ReminderPending bool
}
type GetGroupTimerParams ¶
type GetGroupingSettingsRow ¶
type GetListSettingsRow ¶
type GetRetentionPeriodsRow ¶
type GetRoutePolicyParams ¶
type GetRoutePolicyRow ¶
type GetTimerPolicyParams ¶
type GetTimerPolicyRow ¶
type GetUserTimeZoneParams ¶
type InsertGroupParams ¶
type InsertGroupParams struct {
OrgID int64
PublicID string
Number int64
RouteID int64
GroupKeyLabels []string
GroupKeyValues []byte
GroupKeySha256 []byte
Title string
TitleFromGroupKey bool
Summary pgtype.Text
CommonLabels []byte
CommonAnnotations []byte
IntegrationIds []int64
SeverityLevel string
Urgent bool
FiringAgainAfterID pgtype.Int8
CreatedAt time.Time
}
type InsertMembershipsParams ¶
type InsertNoteParams ¶
type InsertTimelineEntryParams ¶
type InsertTimelineEntryParams struct {
OrgID int64
PublicID string
AlertGroupID int64
At time.Time
Kind string
Event pgtype.Text
EventSeq pgtype.Int8
SystemEvent pgtype.Text
Loudness pgtype.Text
Mentions []string
ActorKind string
ActorUserID pgtype.Int8
ActorServiceAccountID pgtype.Int8
ApiTokenID pgtype.Int8
TokenName pgtype.Text
Transport string
Reason pgtype.Text
FromStatus pgtype.Text
ToStatus pgtype.Text
OwnerUserID pgtype.Int8
PreviousOwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
Fingerprints []string
ReplacedLabel pgtype.Text
LabelConflicts []string
PeriodFrom pgtype.Timestamptz
PeriodTo pgtype.Timestamptz
Detail pgtype.Text
NoticeNumber pgtype.Int8
MissedCount pgtype.Int8
}
type IsActiveUserParams ¶
type ListAlertGroupKeysRow ¶
type ListChangedAlertsParams ¶
type ListChangedAlertsRow ¶
type ListGroupAlertsParams ¶
type ListGroupAlertsRow ¶
type ListGroupAlertsRow struct {
ID int64
Ended bool
State string
StartsAt time.Time
Annotations []byte
EndedAt pgtype.Timestamptz
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
AlertID int64
Fingerprint string
Labels []byte
GeneratorUrl pgtype.Text
LastSeenAt time.Time
IntegrationPublicID string
IntegrationName string
}
type ListGroupsChangedAscParams ¶
type ListGroupsChangedAscParams struct {
OrgID int64
Statuses []string
Number pgtype.Int8
RangeTo time.Time
RangeFrom time.Time
RouteIds []int64
IntegrationIds []int64
Severities []string
Urgent pgtype.Bool
ResolvedBy pgtype.Text
ResolveReason pgtype.Text
Reopened pgtype.Bool
OwnerSet bool
OwnerID pgtype.Int8
SnoozedNoEnd pgtype.Bool
DeliveryProblem pgtype.Bool
Unclaimed pgtype.Bool
Contains []byte
Pattern pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
Lim int32
}
type ListGroupsChangedAscRow ¶
type ListGroupsChangedAscRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
CommonLabels []byte
IntegrationIds []int64
ReopenCount int64
FiringAlertCount int64
ResolvedAlertCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
CreatedAt time.Time
LastChangedAt time.Time
RoutePublicID string
RouteName string
OwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
NewerPublicID string
NewerNumber int64
RouteDeleted bool
DeliveryProblem bool
Unclaimed bool
NextNoticeKind string
NextNoticeAt time.Time
ReminderPending bool
}
type ListGroupsChangedDescParams ¶
type ListGroupsChangedDescParams struct {
OrgID int64
Statuses []string
Number pgtype.Int8
RangeTo time.Time
RangeFrom time.Time
RouteIds []int64
IntegrationIds []int64
Severities []string
Urgent pgtype.Bool
ResolvedBy pgtype.Text
ResolveReason pgtype.Text
Reopened pgtype.Bool
OwnerSet bool
OwnerID pgtype.Int8
SnoozedNoEnd pgtype.Bool
DeliveryProblem pgtype.Bool
Unclaimed pgtype.Bool
Contains []byte
Pattern pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
Lim int32
}
type ListGroupsChangedDescRow ¶
type ListGroupsChangedDescRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
CommonLabels []byte
IntegrationIds []int64
ReopenCount int64
FiringAlertCount int64
ResolvedAlertCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
CreatedAt time.Time
LastChangedAt time.Time
RoutePublicID string
RouteName string
OwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
NewerPublicID string
NewerNumber int64
RouteDeleted bool
DeliveryProblem bool
Unclaimed bool
NextNoticeKind string
NextNoticeAt time.Time
ReminderPending bool
}
type ListGroupsStartedAscParams ¶
type ListGroupsStartedAscParams struct {
OrgID int64
Statuses []string
Number pgtype.Int8
RangeTo time.Time
RangeFrom time.Time
RouteIds []int64
IntegrationIds []int64
Severities []string
Urgent pgtype.Bool
ResolvedBy pgtype.Text
ResolveReason pgtype.Text
Reopened pgtype.Bool
OwnerSet bool
OwnerID pgtype.Int8
SnoozedNoEnd pgtype.Bool
DeliveryProblem pgtype.Bool
Unclaimed pgtype.Bool
Contains []byte
Pattern pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
Lim int32
}
type ListGroupsStartedAscRow ¶
type ListGroupsStartedAscRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
CommonLabels []byte
IntegrationIds []int64
ReopenCount int64
FiringAlertCount int64
ResolvedAlertCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
CreatedAt time.Time
LastChangedAt time.Time
RoutePublicID string
RouteName string
OwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
NewerPublicID string
NewerNumber int64
RouteDeleted bool
DeliveryProblem bool
Unclaimed bool
NextNoticeKind string
NextNoticeAt time.Time
ReminderPending bool
}
type ListGroupsStartedDescParams ¶
type ListGroupsStartedDescParams struct {
OrgID int64
Statuses []string
Number pgtype.Int8
RangeTo time.Time
RangeFrom time.Time
RouteIds []int64
IntegrationIds []int64
Severities []string
Urgent pgtype.Bool
ResolvedBy pgtype.Text
ResolveReason pgtype.Text
Reopened pgtype.Bool
OwnerSet bool
OwnerID pgtype.Int8
SnoozedNoEnd pgtype.Bool
DeliveryProblem pgtype.Bool
Unclaimed pgtype.Bool
Contains []byte
Pattern pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
Lim int32
}
type ListGroupsStartedDescRow ¶
type ListGroupsStartedDescRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
CommonLabels []byte
IntegrationIds []int64
ReopenCount int64
FiringAlertCount int64
ResolvedAlertCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
CreatedAt time.Time
LastChangedAt time.Time
RoutePublicID string
RouteName string
OwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
NewerPublicID string
NewerNumber int64
RouteDeleted bool
DeliveryProblem bool
Unclaimed bool
NextNoticeKind string
NextNoticeAt time.Time
ReminderPending bool
}
type ListIntegrationRefsRow ¶
type ListOwnedGroupsParams ¶
type ListRelatedGroupsParams ¶
type ListRelatedGroupsRow ¶
type ListRoutesByPublicIDRow ¶
type ListStatisticsRoutesRow ¶
type ListTimelineAscParams ¶
type ListTimelineAscRow ¶
type ListTimelineAscRow struct {
ID int64
PublicID string
At time.Time
Kind string
Event pgtype.Text
EventSeq pgtype.Int8
SystemEvent pgtype.Text
Loudness pgtype.Text
Mentions []string
ActorKind string
ActorUserID pgtype.Int8
ActorServiceAccountID pgtype.Int8
TokenName pgtype.Text
Transport string
Reason pgtype.Text
FromStatus pgtype.Text
ToStatus pgtype.Text
OwnerUserID pgtype.Int8
PreviousOwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
Fingerprints []string
ReplacedLabel pgtype.Text
LabelConflicts []string
NoticeNumber pgtype.Int8
MissedCount pgtype.Int8
PeriodFrom pgtype.Timestamptz
PeriodTo pgtype.Timestamptz
Detail pgtype.Text
}
type ListTimelineDescParams ¶
type ListTimelineDescRow ¶
type ListTimelineDescRow struct {
ID int64
PublicID string
At time.Time
Kind string
Event pgtype.Text
EventSeq pgtype.Int8
SystemEvent pgtype.Text
Loudness pgtype.Text
Mentions []string
ActorKind string
ActorUserID pgtype.Int8
ActorServiceAccountID pgtype.Int8
TokenName pgtype.Text
Transport string
Reason pgtype.Text
FromStatus pgtype.Text
ToStatus pgtype.Text
OwnerUserID pgtype.Int8
PreviousOwnerUserID pgtype.Int8
SnoozeUntil pgtype.Timestamptz
Fingerprints []string
ReplacedLabel pgtype.Text
LabelConflicts []string
NoticeNumber pgtype.Int8
MissedCount pgtype.Int8
PeriodFrom pgtype.Timestamptz
PeriodTo pgtype.Timestamptz
Detail pgtype.Text
}
type ListTimelineNotesParams ¶
type ListTimelineNotesRow ¶
type ListUserRefsParams ¶
type ListUserRefsRow ¶
type ListUsersByPublicIDRow ¶
type LockActiveUserParams ¶
type LockDefaultRouteRow ¶
type LockGroupsParams ¶
type LockGroupsRow ¶
type LockGroupsRow struct {
ID int64
PublicID string
Number int64
RouteID int64
MovedFromRouteID pgtype.Int8
GroupKeyLabels []string
GroupKeyValues []byte
GroupKeySha256 []byte
Title string
TitleFromGroupKey bool
Summary pgtype.Text
CommonLabels []byte
CommonAnnotations []byte
IntegrationIds []int64
Status string
SeverityLevel string
Urgent bool
OwnerUserID pgtype.Int8
AcknowledgedAt pgtype.Timestamptz
SnoozeUntil pgtype.Timestamptz
SnoozeNoEnd bool
SnoozedWhileUrgent bool
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
FiringAlertCount int64
ResolvedAlertCount int64
ReopenCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
ReopenDeadline pgtype.Timestamptz
PriorStatus pgtype.Text
PriorOwnerUserID pgtype.Int8
PriorSnoozeUntil pgtype.Timestamptz
PriorSnoozeNoEnd pgtype.Bool
PriorSnoozedWhileUrgent pgtype.Bool
PriorSnoozedByUserID pgtype.Int8
PriorSnoozedByServiceAccountID pgtype.Int8
GraceDeadline pgtype.Timestamptz
FiringAgainAfterID pgtype.Int8
EventSeq int64
CreatedAt time.Time
LastChangedAt time.Time
FirstAcknowledgedAt pgtype.Timestamptz
FirstPublishedAt pgtype.Timestamptz
AckTimeoutStartedAt pgtype.Timestamptz
AckTimeoutNoticesSent int64
Unclaimed bool
RemindersSent int64
RemindersUnanswered int64
LastReminderAt pgtype.Timestamptz
OwnerAnsweredAt pgtype.Timestamptz
}
type LockRouteForMoveParams ¶
type LockRouteForMoveRow ¶
type LockRoutesParams ¶
type LockRoutesRow ¶
type MoveMembershipsParams ¶
type PeekGroupParams ¶
type PeekGroupRow ¶
type PeekGroupRow struct {
RouteID int64
GraceDeadline pgtype.Timestamptz
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountGroups ¶
func (q *Queries) CountGroups(ctx context.Context, arg CountGroupsParams) ([]CountGroupsRow, error)
CountGroups counts the Alert Groups of the list's filters per status, without the status and the cursor; with @with_labels it groups them by common_labels too, for the Matchers that Go applies.
func (*Queries) CountOpenGroupsByIntegration ¶
func (q *Queries) CountOpenGroupsByIntegration(ctx context.Context, arg CountOpenGroupsByIntegrationParams) ([]CountOpenGroupsByIntegrationRow, error)
CountOpenGroupsByIntegration counts the open Alert Groups with an Alert from each of the Integrations (C-09.FR-21): those that deleting it would resolve.
func (*Queries) CountOpenGroupsByRoute ¶
func (q *Queries) CountOpenGroupsByRoute(ctx context.Context, orgID int64) ([]CountOpenGroupsByRouteRow, error)
CountOpenGroupsByRoute counts the open Alert Groups per Route that is not deleted and status, for muster_alert_groups.
func (*Queries) DeleteExpiredGroups ¶
func (q *Queries) DeleteExpiredGroups(ctx context.Context, arg DeleteExpiredGroupsParams) (int64, error)
DeleteExpiredGroups deletes at most @batch_size summary rows resolved before @cutoff. A summary row that an Alert inside another Alert Group still names as where it moved waits for the details of that one to go first; a later Alert Group that fires again after it keeps its row, without the reference (ON DELETE SET NULL).
func (*Queries) DeleteExpiredMemberships ¶
func (q *Queries) DeleteExpiredMemberships(ctx context.Context, arg DeleteExpiredMembershipsParams) (int64, error)
DeleteExpiredMemberships deletes at most @batch_size Alerts inside Alert Groups that ended before @cutoff; rows another transaction holds wait for the next run.
func (*Queries) DeleteTimer ¶
func (q *Queries) DeleteTimer(ctx context.Context, arg DeleteTimerParams) error
DeleteTimer stops an Alert Group's timer of a kind.
func (*Queries) EnsureCounter ¶
EnsureCounter creates the Organization's row of alert_group_counters on first use.
func (*Queries) FindOpenGroup ¶
FindOpenGroup finds the open Alert Group of a Route and Group key values; Alert Groups moved to the Default route are left out, as alert_groups_open_key leaves them out.
func (*Queries) FindReopenableGroup ¶
func (q *Queries) FindReopenableGroup(ctx context.Context, arg FindReopenableGroupParams) (int64, error)
FindReopenableGroup finds the latest system-resolved Alert Group of a Route and Group key values whose Reopen window is still open at now.
func (*Queries) GetDefaultRouteID ¶
GetDefaultRouteID reads the id of the Default route.
func (*Queries) GetGroup ¶
func (q *Queries) GetGroup(ctx context.Context, arg GetGroupParams) (GetGroupRow, error)
GetGroup reads an Alert Group by public_id with its Route, the #N of the Alert Group it fires again after, the label of its latest Replacement, the Alerts still firing in it, retention.alert_details, its Owner and Snooze, and, when a person resolved it, the open Alert Group of the same Route and key that takes part in grouping (C-10.FR-7), and whether its Route was deleted, which Unresolve needs. Urgency is derived from the Route and organization.critical_is_urgent as they are now (C-08.FR-6), so that marking a Route urgent or changing the setting shows on open Alert Groups at once without changing them. It has a Delivery problem (C-13.FR-12) when a delivery of it is Not delivered or deleted in the messenger, waits for a Broken Destination, or has a Thread not attached. Its next notice is the earliest of its ack_timeout and reminder timers (C-17.FR-9): an empty kind and the zero time 0001-01-01 when it has none. A Reminder waits for its Owner's answer while it is acknowledged, a Reminder was sent and the Owner has not answered since the last one (C-17.FR-10).
func (*Queries) GetGroupID ¶
func (q *Queries) GetGroupID(ctx context.Context, arg GetGroupIDParams) (GetGroupIDRow, error)
GetGroupID reads the id of an Alert Group by public_id, with when it was resolved and retention.alert_details, which decide whether its details are removed.
func (*Queries) GetGroupKey ¶
func (q *Queries) GetGroupKey(ctx context.Context, arg GetGroupKeyParams) (GetGroupKeyRow, error)
GetGroupKey reads the Route and the Group key of an Alert Group, for its related Alert Groups.
func (*Queries) GetGroupRef ¶
func (q *Queries) GetGroupRef(ctx context.Context, arg GetGroupRefParams) (GetGroupRefRow, error)
GetGroupRef names an Alert Group by id: its public_id and #N.
func (*Queries) GetGroupTimer ¶
GetGroupTimer reads the deadline of an Alert Group's timer of a kind, after the Alert Group is locked: a timer fired after another change moved it finds a deadline other than the one it was claimed with.
func (*Queries) GetGroupingSettings ¶
func (q *Queries) GetGroupingSettings(ctx context.Context, orgID int64) (GetGroupingSettingsRow, error)
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors The queries of the Alert Group lifecycle. Only this package writes alert_groups, alert_group_alerts, timeline_entries, notes and alert_group_counters (lint 2). Times are business times passed in from Go. GetGroupingSettings reads the Organization settings grouping needs: critical is Urgent and the Instance labels.
func (*Queries) GetLastReminderSeq ¶
func (q *Queries) GetLastReminderSeq(ctx context.Context, arg GetLastReminderSeqParams) (int64, error)
GetLastReminderSeq reads the lifecycle event number of the last Reminder of an Alert Group: a reminder, or a notices_missed that stands for Reminders, which mentions the Owner (C-17.FR-5, FR-7).
func (*Queries) GetListSettings ¶
GetListSettings reads what the list, the reads of one Alert Group and the Snooze presets need of the Organization: retention.alert_details, organization.time_zone, organization.workday_start and organization.week_start.
func (*Queries) GetRetentionPeriods ¶
func (q *Queries) GetRetentionPeriods(ctx context.Context, orgID int64) (GetRetentionPeriodsRow, error)
Retention (C-09.FR-16; design/db/schema.md §6) deletes in batches on the Leader, the rows that already qualify only, so that running it twice deletes nothing more. Details go first: the Alerts inside Alert Groups that ended retention.alert_details ago; then the summary rows resolved retention.alert_group_summaries ago, with their Notes, timers, deliveries and queue rows by cascade. GetRetentionPeriods reads retention.alert_details and retention.alert_group_summaries, in days.
func (*Queries) GetRoutePolicy ¶
func (q *Queries) GetRoutePolicy(ctx context.Context, arg GetRoutePolicyParams) (GetRoutePolicyRow, error)
GetRoutePolicy reads the policy of a Route, deleted or not, that an existing Alert Group belongs to.
func (*Queries) GetSnapshotReceivedAt ¶
func (q *Queries) GetSnapshotReceivedAt(ctx context.Context, arg GetSnapshotReceivedAtParams) (time.Time, error)
GetSnapshotReceivedAt reads when the Stored Snapshot behind a change was received, for the latency of its delivery.
func (*Queries) GetTimerPolicy ¶
func (q *Queries) GetTimerPolicy(ctx context.Context, arg GetTimerPolicyParams) (GetTimerPolicyRow, error)
GetTimerPolicy reads the timer policy of a Route, deleted or not, at the time a timer is set or fires (C-17): the ack timeout, the Reminders and auto-unacknowledge.
func (*Queries) GetUserTimeZone ¶
GetUserTimeZone reads the profile time zone of a User, in which the Snooze presets of that User's Commands end; empty while the profile follows the browser.
func (*Queries) InsertDowntimeEntries ¶
func (q *Queries) InsertDowntimeEntries(ctx context.Context, arg InsertDowntimeEntriesParams) error
InsertDowntimeEntries records "Muster was unavailable from … to …" on Alert Groups.
func (*Queries) InsertGroup ¶
InsertGroup creates an Alert Group, firing.
func (*Queries) InsertMemberships ¶
func (q *Queries) InsertMemberships(ctx context.Context, arg InsertMembershipsParams) error
InsertMemberships adds Alerts to Alert Groups, firing.
func (*Queries) InsertNote ¶
func (q *Queries) InsertNote(ctx context.Context, arg InsertNoteParams) error
InsertNote records a Note with the event_seq of its note_added lifecycle event (C-10.FR-8).
func (*Queries) InsertTimelineEntry ¶
func (q *Queries) InsertTimelineEntry(ctx context.Context, arg InsertTimelineEntryParams) error
InsertTimelineEntry records one Timeline entry: a lifecycle event or a system entry.
func (*Queries) IntegrationStatistics ¶
func (q *Queries) IntegrationStatistics(ctx context.Context, arg IntegrationStatisticsParams) ([]IntegrationStatisticsRow, error)
IntegrationStatistics aggregates the Alert Groups per Integration — one with Alerts from several counts for each — only the Integrations @integration_ids when set.
func (*Queries) IsActiveUser ¶
IsActiveUser reports whether a User can still own an Alert Group: a disabled or deleted Owner has no acknowledgements.
func (*Queries) ListAlertGroupKeys ¶
func (q *Queries) ListAlertGroupKeys(ctx context.Context, arg ListAlertGroupKeysParams) ([]ListAlertGroupKeysRow, error)
ListAlertGroupKeys lists the Alertmanager groupKeys that listed each Alert during its current or last firing.
func (*Queries) ListChangedAlerts ¶
func (q *Queries) ListChangedAlerts(ctx context.Context, arg ListChangedAlertsParams) ([]ListChangedAlertsRow, error)
ListChangedAlerts reads the Alerts of a Snapshot's changes, with the Route and Severity level routing stamped.
func (*Queries) ListFiringMemberships ¶
func (q *Queries) ListFiringMemberships(ctx context.Context, arg ListFiringMembershipsParams) ([]ListFiringMembershipsRow, error)
ListFiringMemberships reads where the Alerts fire: an Alert lives in at most one Alert Group at a time.
func (*Queries) ListGroupAlerts ¶
func (q *Queries) ListGroupAlerts(ctx context.Context, arg ListGroupAlertsParams) ([]ListGroupAlertsRow, error)
ListGroupAlerts lists the Alerts of an Alert Group, firing first, then those that ended, after a position; @rank is 0 for firing and 1 for ended.
func (*Queries) ListGroupFiringAlerts ¶
func (q *Queries) ListGroupFiringAlerts(ctx context.Context, arg ListGroupFiringAlertsParams) ([]ListGroupFiringAlertsRow, error)
ListGroupFiringAlerts lists the Alerts firing in Alert Groups with their labels: the comparison of a Replacement, and the tails that a Grace period end groups again.
func (*Queries) ListGroupsChangedAsc ¶
func (q *Queries) ListGroupsChangedAsc(ctx context.Context, arg ListGroupsChangedAscParams) ([]ListGroupsChangedAscRow, error)
ListGroupsChangedAsc reads a batch of the Alert Group list, earliest change first, after the cursor when given.
func (*Queries) ListGroupsChangedDesc ¶
func (q *Queries) ListGroupsChangedDesc(ctx context.Context, arg ListGroupsChangedDescParams) ([]ListGroupsChangedDescRow, error)
ListGroupsChangedDesc reads a batch of the Alert Group list, latest change first, after the cursor when given.
func (*Queries) ListGroupsStartedAsc ¶
func (q *Queries) ListGroupsStartedAsc(ctx context.Context, arg ListGroupsStartedAscParams) ([]ListGroupsStartedAscRow, error)
ListGroupsStartedAsc reads a batch of the Alert Group list, oldest start first, after the cursor when given.
func (*Queries) ListGroupsStartedDesc ¶
func (q *Queries) ListGroupsStartedDesc(ctx context.Context, arg ListGroupsStartedDescParams) ([]ListGroupsStartedDescRow, error)
The Alert Group list (C-09.FR-13) reads the summary rows in one of four orders. Every query runs with the plan of its parameters (Store.CustomPlans), so that the filters left unset fold away and the planner picks the index of the filters that are set: the partial open index for the default tab, the started or changed index for a range, the trigram indexes for text, the jsonb_path_ops index for = label Matchers, the unique (org_id, number) for #N. The time range selects lifetimes that overlap it — created_at < to AND (resolved_at IS NULL OR resolved_at >= from), written with the status that the CHECK ties to resolved_at, so that the open index and alert_groups_resolved_idx serve it — and is ignored for a number. Label Matchers other than = with a value are matched in Go on common_labels, after these conditions; urgency and the newer open Alert Group are derived as in GetGroup. The Owner filter, with @owner_set, selects the Alert Groups the User @owner_id owns, or nobody owns when it is null. The Delivery problem (C-13.FR-12) and the next notice (C-17.FR-9) are derived as in GetGroup; @unclaimed selects the Unclaimed Alert Groups or the others (C-09.FR-13). ListGroupsStartedDesc reads a batch of the Alert Group list, newest start first, after the cursor when given.
func (*Queries) ListIntegrationRefs ¶
func (q *Queries) ListIntegrationRefs(ctx context.Context, arg ListIntegrationRefsParams) ([]ListIntegrationRefsRow, error)
ListIntegrationRefs names Integrations, deleted ones included.
func (*Queries) ListIntegrationsByPublicID ¶
func (q *Queries) ListIntegrationsByPublicID(ctx context.Context, arg ListIntegrationsByPublicIDParams) ([]ListIntegrationsByPublicIDRow, error)
ListIntegrationsByPublicID names Integrations, deleted ones included, by public_id.
func (*Queries) ListJoinedDuringSnooze ¶
func (q *Queries) ListJoinedDuringSnooze(ctx context.Context, arg ListJoinedDuringSnoozeParams) ([]string, error)
ListJoinedDuringSnooze lists the fingerprints of the Alerts that joined an Alert Group during its current Snooze (C-09.FR-8): after the last Timeline entry that took it into snoozed from another status, and, when that entry is a Reopen into snoozed, the Alerts that reopened it.
func (*Queries) ListOpenGroupIDs ¶
ListOpenGroupIDs lists the open Alert Groups of the Organization, for the downtime entries.
func (*Queries) ListOpenGroupsOfRoute ¶
func (q *Queries) ListOpenGroupsOfRoute(ctx context.Context, arg ListOpenGroupsOfRouteParams) ([]int64, error)
ListOpenGroupsOfRoute lists the open Alert Groups of a Route.
func (*Queries) ListOwnedGroups ¶
ListOwnedGroups lists the Alert Groups a User owns, for the release of a disabled or deleted Owner (C-03.FR-13): acknowledged by them, or resolved by the system inside a Reopen window that would reopen them acknowledged by them.
func (*Queries) ListRelatedGroups ¶
func (q *Queries) ListRelatedGroups(ctx context.Context, arg ListRelatedGroupsParams) ([]ListRelatedGroupsRow, error)
ListRelatedGroups lists the other Alert Groups of a Route with the same Group key values, newest first, after the cursor when given (C-09.FR-20; alert_groups_related_idx).
func (*Queries) ListRoutePublicIDs ¶
ListRoutePublicIDs lists the Routes that are not deleted, for the zero series of muster_alert_groups.
func (*Queries) ListRoutesByPublicID ¶
func (q *Queries) ListRoutesByPublicID(ctx context.Context, arg ListRoutesByPublicIDParams) ([]ListRoutesByPublicIDRow, error)
ListRoutesByPublicID names Routes, deleted ones included, by public_id: the Route filter of the list and of the statistics.
func (*Queries) ListServiceAccountRefs ¶
func (q *Queries) ListServiceAccountRefs(ctx context.Context, arg ListServiceAccountRefsParams) ([]ListServiceAccountRefsRow, error)
ListServiceAccountRefs names Service accounts, deleted ones included.
func (*Queries) ListStatisticsIntegrations ¶
func (q *Queries) ListStatisticsIntegrations(ctx context.Context, arg ListStatisticsIntegrationsParams) ([]ListStatisticsIntegrationsRow, error)
ListStatisticsIntegrations lists the subjects of the statistics per Integration, as ListStatisticsRoutes does.
func (*Queries) ListStatisticsRoutes ¶
func (q *Queries) ListStatisticsRoutes(ctx context.Context, arg ListStatisticsRoutesParams) ([]ListStatisticsRoutesRow, error)
ListStatisticsRoutes lists the subjects of the statistics per Route: those that are not deleted and @with_ids (the deleted ones with Alert Groups in the period), or only @only_ids when set.
func (*Queries) ListTimelineAsc ¶
func (q *Queries) ListTimelineAsc(ctx context.Context, arg ListTimelineAscParams) ([]ListTimelineAscRow, error)
ListTimelineAsc reads the Timeline entries of an Alert Group, oldest first, after a position.
func (*Queries) ListTimelineDeliveryEvents ¶
func (q *Queries) ListTimelineDeliveryEvents(ctx context.Context, arg ListTimelineDeliveryEventsParams) ([]ListTimelineDeliveryEventsRow, error)
ListTimelineDeliveryEvents reads the delivery events of an Alert Group for the Timeline, newest first with @descending, after a position.
func (*Queries) ListTimelineDesc ¶
func (q *Queries) ListTimelineDesc(ctx context.Context, arg ListTimelineDescParams) ([]ListTimelineDescRow, error)
The Timeline merges three sources by (at, source, id): its entries (source 0), Notes (1) and delivery events (2). A page reads up to @lim of each after the position of the previous page and keeps the first @lim of the merge. ListTimelineDesc reads the Timeline entries of an Alert Group, newest first, before a position.
func (*Queries) ListTimelineNotes ¶
func (q *Queries) ListTimelineNotes(ctx context.Context, arg ListTimelineNotesParams) ([]ListTimelineNotesRow, error)
ListTimelineNotes reads the Notes of an Alert Group for the Timeline, newest first with @descending, after a position.
func (*Queries) ListUserRefs ¶
func (q *Queries) ListUserRefs(ctx context.Context, arg ListUserRefsParams) ([]ListUserRefsRow, error)
ListUserRefs names Users, deleted ones included.
func (*Queries) ListUsersByPublicID ¶
func (q *Queries) ListUsersByPublicID(ctx context.Context, arg ListUsersByPublicIDParams) ([]ListUsersByPublicIDRow, error)
ListUsersByPublicID names Users, deleted ones included, by public_id: the Owner filter of the list.
func (*Queries) LockActiveUser ¶
LockActiveUser locks the row of a User who acknowledges, FOR SHARE, while they are active: a disable or a delete of that User, which releases their acknowledgements, waits for the acknowledgement or makes it refused.
func (*Queries) LockCounter ¶
LockCounter locks the Organization's counter row: every change that makes an Alert Group open — a creation or a Reopen — takes it first, so that two of them never race for one Route and Group key.
func (*Queries) LockDefaultRoute ¶
LockDefaultRoute locks the Default route FOR SHARE, for the Alerts whose Route was deleted meanwhile.
func (*Queries) LockGroups ¶
func (q *Queries) LockGroups(ctx context.Context, arg LockGroupsParams) ([]LockGroupsRow, error)
LockGroups locks Alert Groups for a change, in id order, so that two transactions never wait for each other. The lock is FOR NO KEY UPDATE, as a change never deletes an Alert Group or changes its id: it excludes every other change, but not the FOR KEY SHARE that a foreign-key check of a row referencing the Alert Group takes, such as a delivery row its transaction updates a second time while the dispatcher waits for that row (the lock order of the delivery worker, internal/delivery/worker.go).
func (*Queries) LockRouteForMove ¶
func (q *Queries) LockRouteForMove(ctx context.Context, arg LockRouteForMoveParams) (LockRouteForMoveRow, error)
LockRouteForMove locks a Route that is not deleted against grouping, which takes it FOR SHARE, while its open Alert Groups move to the Default route.
func (*Queries) LockRoutes ¶
func (q *Queries) LockRoutes(ctx context.Context, arg LockRoutesParams) ([]LockRoutesRow, error)
LockRoutes locks the Routes that are not deleted FOR SHARE before grouping creates or joins an Alert Group on them, in id order: a deletion, which locks its Route FOR NO KEY UPDATE and then counts the open Alert Groups, waits for the Snapshot, or commits first and leaves the Route out of the result.
func (*Queries) MoveMemberships ¶
func (q *Queries) MoveMemberships(ctx context.Context, arg MoveMembershipsParams) error
MoveMemberships ends firing memberships whose Alerts were grouped again, into the Alert Group that took them.
func (*Queries) NextNumber ¶
NextNumber takes the next #N; a rollback returns it, so no gap appears.
func (*Queries) NotifyTimers ¶
NotifyTimers wakes the timer workers of every replica once the transaction commits.
func (*Queries) PeekGroup ¶
func (q *Queries) PeekGroup(ctx context.Context, arg PeekGroupParams) (PeekGroupRow, error)
PeekGroup reads, without a lock, the Route and the Grace period of an Alert Group, so that the end of its Grace period finds the Alert Groups it changes before it locks them all in id order.
func (*Queries) ResolveMemberships ¶
func (q *Queries) ResolveMemberships(ctx context.Context, arg ResolveMembershipsParams) error
ResolveMemberships ends firing memberships whose Alerts resolved, each with its reason.
func (*Queries) RollbackGrouping ¶
RollbackGrouping undoes grouping back to SavepointGrouping, releasing the Alert Group locks it took since.
func (*Queries) RouteStatistics ¶
func (q *Queries) RouteStatistics(ctx context.Context, arg RouteStatisticsParams) ([]RouteStatisticsRow, error)
The statistics (C-09.FR-15) aggregate the summary rows that started in [@range_from, @range_to): per subject, and per subject and day of start in the time zone @time_zone. Time to resolve counts the resolved ones, time to acknowledge those acknowledged at least once; both are seconds, their median and 95th percentile interpolated, and 0 when their count is 0. RouteStatistics aggregates the Alert Groups per Route, only the Routes @route_ids when set.
func (*Queries) SaveGroup ¶
func (q *Queries) SaveGroup(ctx context.Context, arg SaveGroupParams) error
SaveGroup writes the state of an Alert Group after a change.
func (*Queries) SavepointGrouping ¶
SavepointGrouping marks where grouping that joins open Alert Groups without the counter row starts, so that it can start again under the counter row when an Alert Group it found turns out to need a creation or a Reopen.
func (*Queries) UpdateMemberships ¶
func (q *Queries) UpdateMemberships(ctx context.Context, arg UpdateMembershipsParams) error
UpdateMemberships records the startsAt of a Continuation and the annotations as last seen.
func (*Queries) UpsertTimer ¶
func (q *Queries) UpsertTimer(ctx context.Context, arg UpsertTimerParams) error
UpsertTimer sets the deadline of an Alert Group's timer of a kind, with the number of the notice or Reminder it stands for, free of any lease.
type RouteStatisticsParams ¶
type RouteStatisticsRow ¶
type SaveGroupParams ¶
type SaveGroupParams struct {
RouteID int64
MovedFromRouteID pgtype.Int8
Title string
TitleFromGroupKey bool
Summary pgtype.Text
CommonLabels []byte
CommonAnnotations []byte
IntegrationIds []int64
Status string
SeverityLevel string
Urgent bool
OwnerUserID pgtype.Int8
AcknowledgedAt pgtype.Timestamptz
SnoozeUntil pgtype.Timestamptz
SnoozeNoEnd bool
SnoozedWhileUrgent bool
SnoozedByUserID pgtype.Int8
SnoozedByServiceAccountID pgtype.Int8
FiringAlertCount int64
ResolvedAlertCount int64
ReopenCount int64
ResolvedAt pgtype.Timestamptz
ResolvedByKind pgtype.Text
ResolvedByUserID pgtype.Int8
ResolvedByServiceAccountID pgtype.Int8
ResolveReason pgtype.Text
ResolveReasonText pgtype.Text
ReopenDeadline pgtype.Timestamptz
PriorStatus pgtype.Text
PriorOwnerUserID pgtype.Int8
PriorSnoozeUntil pgtype.Timestamptz
PriorSnoozeNoEnd pgtype.Bool
PriorSnoozedWhileUrgent pgtype.Bool
PriorSnoozedByUserID pgtype.Int8
PriorSnoozedByServiceAccountID pgtype.Int8
GraceDeadline pgtype.Timestamptz
EventSeq int64
LastChangedAt time.Time
FirstAcknowledgedAt pgtype.Timestamptz
FirstPublishedAt pgtype.Timestamptz
AckTimeoutStartedAt pgtype.Timestamptz
AckTimeoutNoticesSent int64
Unclaimed bool
RemindersSent int64
RemindersUnanswered int64
LastReminderAt pgtype.Timestamptz
OwnerAnsweredAt pgtype.Timestamptz
OrgID int64
ID int64
}