Documentation
¶
Index ¶
- type BumpRouteOrderParams
- type BumpRoutesOfDestinationParams
- type BumpRoutesOfDestinationRow
- type CountOpenAlertGroupsParams
- type DBTX
- type DeleteDestinationTeamsParams
- type DeleteRouteChainsExceptParams
- type DeleteRouteDestinationsParams
- type DeleteRouteMatchersParams
- type DeleteRouteParams
- type DismissRouteSuggestionParams
- type DropDeletedRouteDestinationsParams
- type EnsureDefaultRouteParams
- type GetRouteParams
- type GetRouteRow
- type GetRoutingStampRow
- type HasOpenAlertGroupsParams
- type InsertAlertTeamsParams
- type InsertOpenGroupUpdateParams
- type InsertRouteDestinationsParams
- type InsertRouteMatcherParams
- type InsertRouteParams
- type ListAlertLabelsParams
- type ListAlertLabelsRow
- type ListAlertingDestinationsRow
- type ListAlertingGatewaysRow
- type ListAlertingIntegrationsRow
- type ListAlertingSchedulesRow
- type ListHeartbeatIntegrationsRow
- type ListOpenAlertGroupCountsRow
- type ListPreviewDestinationsParams
- type ListPreviewDestinationsRow
- type ListPreviewTeamEntriesParams
- type ListPreviewTeamEntriesRow
- type ListPreviewTeamsParams
- type ListPreviewTeamsRow
- type ListRouteChainsParams
- type ListRouteChainsRow
- type ListRouteDestinationIDsParams
- type ListRouteDestinationIDsRow
- type ListRouteInfoRow
- type ListRouteLabelSuggestionsParams
- type ListRouteLabelSuggestionsRow
- type ListRouteMatchersParams
- type ListRouteMatchersRow
- type ListRouteSuggestionDismissalsParams
- type ListRoutesRow
- type ListTeamsOfDestinationParams
- type ListUserTeamsParams
- type LockOwningTeamParams
- type LockOwningTeamRow
- type LockRouteMembershipParams
- type LockRouteParams
- type LockTeamMembershipParams
- type Queries
- func (q *Queries) BumpRouteOrder(ctx context.Context, arg BumpRouteOrderParams) (int64, error)
- func (q *Queries) BumpRoutesOfDestination(ctx context.Context, arg BumpRoutesOfDestinationParams) ([]BumpRoutesOfDestinationRow, error)
- func (q *Queries) CountOpenAlertGroups(ctx context.Context, arg CountOpenAlertGroupsParams) (int64, error)
- func (q *Queries) DeleteDestinationTeams(ctx context.Context, arg DeleteDestinationTeamsParams) error
- func (q *Queries) DeleteRoute(ctx context.Context, arg DeleteRouteParams) error
- func (q *Queries) DeleteRouteChainsExcept(ctx context.Context, arg DeleteRouteChainsExceptParams) error
- func (q *Queries) DeleteRouteDestinations(ctx context.Context, arg DeleteRouteDestinationsParams) error
- func (q *Queries) DeleteRouteMatchers(ctx context.Context, arg DeleteRouteMatchersParams) error
- func (q *Queries) DismissRouteSuggestion(ctx context.Context, arg DismissRouteSuggestionParams) error
- func (q *Queries) DropDeletedRouteDestinations(ctx context.Context, arg DropDeletedRouteDestinationsParams) error
- func (q *Queries) EnsureDefaultRoute(ctx context.Context, arg EnsureDefaultRouteParams) (string, error)
- func (q *Queries) GetRoute(ctx context.Context, arg GetRouteParams) (GetRouteRow, error)
- func (q *Queries) GetRouteOrderVersion(ctx context.Context, orgID int64) (int64, error)
- func (q *Queries) GetRoutingStamp(ctx context.Context, orgID int64) (GetRoutingStampRow, error)
- func (q *Queries) HasOpenAlertGroups(ctx context.Context, arg HasOpenAlertGroupsParams) (bool, error)
- func (q *Queries) InsertAlertTeams(ctx context.Context, arg InsertAlertTeamsParams) error
- func (q *Queries) InsertOpenGroupUpdate(ctx context.Context, arg InsertOpenGroupUpdateParams) error
- func (q *Queries) InsertRoute(ctx context.Context, arg InsertRouteParams) (int64, error)
- func (q *Queries) InsertRouteDestinations(ctx context.Context, arg InsertRouteDestinationsParams) error
- func (q *Queries) InsertRouteMatcher(ctx context.Context, arg InsertRouteMatcherParams) error
- func (q *Queries) ListAlertLabels(ctx context.Context, arg ListAlertLabelsParams) ([]ListAlertLabelsRow, error)
- func (q *Queries) ListAlertingDestinations(ctx context.Context, orgID int64) ([]ListAlertingDestinationsRow, error)
- func (q *Queries) ListAlertingGateways(ctx context.Context, orgID int64) ([]ListAlertingGatewaysRow, error)
- func (q *Queries) ListAlertingIntegrations(ctx context.Context, orgID int64) ([]ListAlertingIntegrationsRow, error)
- func (q *Queries) ListAlertingSchedules(ctx context.Context, orgID int64) ([]ListAlertingSchedulesRow, error)
- func (q *Queries) ListHeartbeatIntegrations(ctx context.Context, orgID int64) ([]ListHeartbeatIntegrationsRow, error)
- func (q *Queries) ListOpenAlertGroupCounts(ctx context.Context, orgID int64) ([]ListOpenAlertGroupCountsRow, error)
- func (q *Queries) ListPreviewDestinations(ctx context.Context, arg ListPreviewDestinationsParams) ([]ListPreviewDestinationsRow, error)
- func (q *Queries) ListPreviewTeamEntries(ctx context.Context, arg ListPreviewTeamEntriesParams) ([]ListPreviewTeamEntriesRow, error)
- func (q *Queries) ListPreviewTeams(ctx context.Context, arg ListPreviewTeamsParams) ([]ListPreviewTeamsRow, error)
- func (q *Queries) ListRouteChains(ctx context.Context, arg ListRouteChainsParams) ([]ListRouteChainsRow, error)
- func (q *Queries) ListRouteDestinationIDs(ctx context.Context, arg ListRouteDestinationIDsParams) ([]ListRouteDestinationIDsRow, error)
- func (q *Queries) ListRouteInfo(ctx context.Context, orgID int64) ([]ListRouteInfoRow, error)
- func (q *Queries) ListRouteLabelSuggestions(ctx context.Context, arg ListRouteLabelSuggestionsParams) ([]ListRouteLabelSuggestionsRow, error)
- func (q *Queries) ListRouteMatchers(ctx context.Context, arg ListRouteMatchersParams) ([]ListRouteMatchersRow, error)
- func (q *Queries) ListRouteSuggestionDismissals(ctx context.Context, arg ListRouteSuggestionDismissalsParams) ([]string, error)
- func (q *Queries) ListRoutes(ctx context.Context, orgID int64) ([]ListRoutesRow, error)
- func (q *Queries) ListTeamsOfDestination(ctx context.Context, arg ListTeamsOfDestinationParams) ([]int64, error)
- func (q *Queries) ListUserTeams(ctx context.Context, arg ListUserTeamsParams) ([]string, error)
- func (q *Queries) LockOwningTeam(ctx context.Context, arg LockOwningTeamParams) (LockOwningTeamRow, error)
- func (q *Queries) LockRoute(ctx context.Context, arg LockRouteParams) (int64, error)
- func (q *Queries) LockRouteMembership(ctx context.Context, arg LockRouteMembershipParams) error
- func (q *Queries) LockTeamMembership(ctx context.Context, arg LockTeamMembershipParams) error
- func (q *Queries) NotifyOpenGroupUpdates(ctx context.Context, channel string) error
- func (q *Queries) ResetAlertTeams(ctx context.Context, arg ResetAlertTeamsParams) error
- func (q *Queries) ResolveDestinations(ctx context.Context, arg ResolveDestinationsParams) ([]ResolveDestinationsRow, error)
- func (q *Queries) ResolveRouteChains(ctx context.Context, arg ResolveRouteChainsParams) ([]ResolveRouteChainsRow, error)
- func (q *Queries) RestampAlertRoutes(ctx context.Context, arg RestampAlertRoutesParams) error
- func (q *Queries) SetAlertRoutes(ctx context.Context, arg SetAlertRoutesParams) error
- func (q *Queries) SetRouteDestinationConditions(ctx context.Context, arg SetRouteDestinationConditionsParams) error
- func (q *Queries) SetRoutePositions(ctx context.Context, arg SetRoutePositionsParams) error
- func (q *Queries) ShareTeamEvaluation(ctx context.Context, arg ShareTeamEvaluationParams) error
- func (q *Queries) UpdateRoute(ctx context.Context, arg UpdateRouteParams) error
- func (q *Queries) UpsertRouteChains(ctx context.Context, arg UpsertRouteChainsParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResetAlertTeamsParams
- type ResolveDestinationsParams
- type ResolveDestinationsRow
- type ResolveRouteChainsParams
- type ResolveRouteChainsRow
- type RestampAlertRoutesParams
- type SetAlertRoutesParams
- type SetRouteDestinationConditionsParams
- type SetRoutePositionsParams
- type ShareTeamEvaluationParams
- type UpdateRouteParams
- type UpsertRouteChainsParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BumpRouteOrderParams ¶
type DeleteRouteParams ¶
type DeleteRouteParams struct {
Now pgtype.Timestamptz
OrgID int64
ID int64
}
type EnsureDefaultRouteParams ¶
type EnsureDefaultRouteParams struct {
OrgID int64
PublicID string
Name string
Description string
MinimumSeverity string
GroupKey []string
ReopenWindowSeconds int64
GracePeriodSeconds int64
UrgentRiseRemovesAck bool
SnoozeDurationsSeconds []int64
ThreadBatchingWindowSeconds int64
StormThreshold int64
Language string
AckTimeoutEnabled bool
AckTimeoutFirstIntervalSeconds int64
RemindersEnabled bool
RemindersFirstIntervalSeconds int64
RemindersCapSeconds int64
AutoUnacknowledge bool
Now time.Time
}
type GetRouteParams ¶
type GetRouteRow ¶
type GetRouteRow struct {
ID int64
PublicID string
Name string
Description string
Position int64
IsDefault bool
MinimumSeverity string
GroupKey []string
ReopenWindowSeconds int64
GracePeriodSeconds int64
UrgentRiseRemovesAck bool
SnoozeDurationsSeconds []int64
ThreadBatchingWindowSeconds int64
StormThreshold int64
Language string
TemplateRootMessage pgtype.Text
TemplateLine pgtype.Text
TemplateAckTimeoutNotice pgtype.Text
AckTimeoutEnabled bool
AckTimeoutFirstIntervalSeconds int64
RemindersEnabled bool
RemindersFirstIntervalSeconds int64
RemindersCapSeconds int64
AutoUnacknowledge bool
CreatedAt time.Time
Version int64
TemplateErrorSince pgtype.Timestamptz
TemplateError pgtype.Text
Place int64
StormSince pgtype.Timestamptz
StormAlertGroupCount pgtype.Int8
OwningTeamID pgtype.Int8
OwningTeamPublicID pgtype.Text
OwningTeamName pgtype.Text
OwningTeamSlug pgtype.Text
OwningTeamDeleted bool
MessageLabels []string
SeverityLabel string
TeamLabel string
DeliverToTeams bool
RunTeamChains bool
ManagedBy pgtype.Text
}
type GetRoutingStampRow ¶
type InsertAlertTeamsParams ¶
type InsertRouteParams ¶
type InsertRouteParams struct {
OrgID int64
PublicID string
Name string
Description string
First bool
MinimumSeverity string
GroupKey []string
ReopenWindowSeconds int64
GracePeriodSeconds int64
UrgentRiseRemovesAck bool
SnoozeDurationsSeconds []int64
ThreadBatchingWindowSeconds int64
StormThreshold int64
Language string
TemplateRootMessage pgtype.Text
TemplateLine pgtype.Text
TemplateAckTimeoutNotice pgtype.Text
AckTimeoutEnabled bool
AckTimeoutFirstIntervalSeconds int64
RemindersEnabled bool
RemindersFirstIntervalSeconds int64
RemindersCapSeconds int64
AutoUnacknowledge bool
OwningTeamID pgtype.Int8
MessageLabels []string
DeliverToTeams bool
RunTeamChains bool
ManagedBy pgtype.Text
Now time.Time
}
type ListAlertLabelsParams ¶
type ListAlertLabelsRow ¶
type ListAlertingGatewaysRow ¶
type ListPreviewTeamsParams ¶
type ListPreviewTeamsRow ¶
type ListRouteChainsParams ¶
type ListRouteChainsRow ¶
type ListRouteInfoRow ¶
type ListRouteMatchersParams ¶
type ListRouteMatchersRow ¶
type ListRoutesRow ¶
type ListRoutesRow struct {
ID int64
PublicID string
Name string
Description string
Position int64
IsDefault bool
MinimumSeverity string
GroupKey []string
ReopenWindowSeconds int64
GracePeriodSeconds int64
UrgentRiseRemovesAck bool
SnoozeDurationsSeconds []int64
ThreadBatchingWindowSeconds int64
StormThreshold int64
Language string
TemplateRootMessage pgtype.Text
TemplateLine pgtype.Text
TemplateAckTimeoutNotice pgtype.Text
AckTimeoutEnabled bool
AckTimeoutFirstIntervalSeconds int64
RemindersEnabled bool
RemindersFirstIntervalSeconds int64
RemindersCapSeconds int64
AutoUnacknowledge bool
CreatedAt time.Time
Version int64
TemplateErrorSince pgtype.Timestamptz
TemplateError pgtype.Text
StormSince pgtype.Timestamptz
StormAlertGroupCount pgtype.Int8
OwningTeamID pgtype.Int8
OwningTeamPublicID pgtype.Text
OwningTeamName pgtype.Text
OwningTeamSlug pgtype.Text
OwningTeamDeleted bool
MessageLabels []string
SeverityLabel string
TeamLabel string
DeliverToTeams bool
RunTeamChains bool
ManagedBy pgtype.Text
}
type ListUserTeamsParams ¶
type LockOwningTeamParams ¶
type LockOwningTeamRow ¶
type LockRouteParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BumpRouteOrder ¶
BumpRouteOrder bumps the version of the Route list, the list ETag, and returns the new one; with @expected it returns no row unless the version is still that one. The row lock serializes the changes of the list.
func (*Queries) BumpRoutesOfDestination ¶
func (q *Queries) BumpRoutesOfDestination(ctx context.Context, arg BumpRoutesOfDestinationParams) ([]BumpRoutesOfDestinationRow, error)
BumpRoutesOfDestination gives each Route that is not deleted of a Destination about to leave them a new version, locking them in id order, and returns them in that order.
func (*Queries) CountOpenAlertGroups ¶
func (q *Queries) CountOpenAlertGroups(ctx context.Context, arg CountOpenAlertGroupsParams) (int64, error)
CountOpenAlertGroups counts the open Alert Groups of a Route, read-only (only groups writes alert_groups); a deletion counts them after LockRoute, so that a Snapshot grouping on the Route either committed before or waits.
func (*Queries) DeleteDestinationTeams ¶
func (q *Queries) DeleteDestinationTeams(ctx context.Context, arg DeleteDestinationTeamsParams) error
DeleteDestinationTeams removes a deleted Destination from every Team.
func (*Queries) DeleteRoute ¶
func (q *Queries) DeleteRoute(ctx context.Context, arg DeleteRouteParams) error
DeleteRoute soft-deletes a Route: it leaves every list and the evaluation order at once.
func (*Queries) DeleteRouteChainsExcept ¶
func (q *Queries) DeleteRouteChainsExcept(ctx context.Context, arg DeleteRouteChainsExceptParams) error
DeleteRouteChainsExcept removes the Escalation chains of a Route other than those it keeps.
func (*Queries) DeleteRouteDestinations ¶
func (q *Queries) DeleteRouteDestinations(ctx context.Context, arg DeleteRouteDestinationsParams) error
DeleteRouteDestinations removes Destinations from a Route.
func (*Queries) DeleteRouteMatchers ¶
func (q *Queries) DeleteRouteMatchers(ctx context.Context, arg DeleteRouteMatchersParams) error
DeleteRouteMatchers removes the Matchers of a Route before they are written again.
func (*Queries) DismissRouteSuggestion ¶
func (q *Queries) DismissRouteSuggestion(ctx context.Context, arg DismissRouteSuggestionParams) error
DismissRouteSuggestion records that a User dismissed a Route suggestion; a second dismissal changes nothing.
func (*Queries) DropDeletedRouteDestinations ¶
func (q *Queries) DropDeletedRouteDestinations(ctx context.Context, arg DropDeletedRouteDestinationsParams) error
DropDeletedRouteDestinations removes from a Route the entries of Destinations that are deleted: one a save wrote while the Destination's deletion committed, which no read returns.
func (*Queries) EnsureDefaultRoute ¶
func (q *Queries) EnsureDefaultRoute(ctx context.Context, arg EnsureDefaultRouteParams) (string, error)
EnsureDefaultRoute creates the Default route of the Organization when it has none, and returns its public_id only when it created it.
func (*Queries) GetRoute ¶
func (q *Queries) GetRoute(ctx context.Context, arg GetRouteParams) (GetRouteRow, error)
GetRoute reads a Route that is not deleted with its place in evaluation order, zero-based, its template error, its active Storm and the Organization's severity and Team labels, as ListRoutes does.
func (*Queries) GetRouteOrderVersion ¶
GetRouteOrderVersion reads the version of the Route list.
func (*Queries) GetRoutingStamp ¶
GetRoutingStamp reads what decides whether the cached evaluation order is current — the version of the Route list, which creation, deletion and reordering bump, with the sum of the versions of the Routes, which every edit bumps — and the Severity level settings of the Organization.
func (*Queries) HasOpenAlertGroups ¶
func (q *Queries) HasOpenAlertGroups(ctx context.Context, arg HasOpenAlertGroupsParams) (bool, error)
HasOpenAlertGroups reports whether a Route has open Alert Groups, read-only (only groups writes alert_groups), those moved to it included: a changed Minimum severity reaches them through open_group_updates.
func (*Queries) InsertAlertTeams ¶
func (q *Queries) InsertAlertTeams(ctx context.Context, arg InsertAlertTeamsParams) error
InsertAlertTeams records the Teams of Alerts that start firing with the rule that decided each, and the Team matcher of the rule matcher; an empty matcher is null.
func (*Queries) InsertOpenGroupUpdate ¶
func (q *Queries) InsertOpenGroupUpdate(ctx context.Context, arg InsertOpenGroupUpdateParams) error
InsertOpenGroupUpdate requests that a change of configuration of the Route @route_id reach its open Alert Groups (C-26.FR-9): the worker of any replica claims the row. A row of the Route that no worker has claimed yet already covers the save when it is of the same kind, or when both kinds re-render the Root messages (route_message_labels and route_message_settings, which share their run): its run reads the Route as it is then. It is locked, so that no worker claims it before this transaction commits, and no second one is inserted.
func (*Queries) InsertRoute ¶
InsertRoute creates a Route at the last position before the Default route, or with @first at the top of the list. urgent is written as minimum_severity = 'critical', which a 0.1 replica of a rolling update still reads (C-26.FR-10).
func (*Queries) InsertRouteDestinations ¶
func (q *Queries) InsertRouteDestinations(ctx context.Context, arg InsertRouteDestinationsParams) error
InsertRouteDestinations adds Destinations to a Route with their Severity conditions, one each, added now.
func (*Queries) InsertRouteMatcher ¶
func (q *Queries) InsertRouteMatcher(ctx context.Context, arg InsertRouteMatcherParams) error
InsertRouteMatcher writes one Matcher of a Route at its position.
func (*Queries) ListAlertLabels ¶
func (q *Queries) ListAlertLabels(ctx context.Context, arg ListAlertLabelsParams) ([]ListAlertLabelsRow, error)
ListAlertLabels reads the labels of Alerts, with their Static labels applied: the Alerts ids, and the Alerts listed_ids that fire without a Route.
func (*Queries) ListAlertingDestinations ¶
func (q *Queries) ListAlertingDestinations(ctx context.Context, orgID int64) ([]ListAlertingDestinationsRow, error)
ListAlertingDestinations lists the Destinations that are not deleted, of every type, with what the Internal alerts about a Destination carry of them: the public_id and the name.
func (*Queries) ListAlertingGateways ¶
func (q *Queries) ListAlertingGateways(ctx context.Context, orgID int64) ([]ListAlertingGatewaysRow, error)
ListAlertingGateways lists the Notification gateways — the Bridge Connections that are not deleted whose stored info declares the role gateway — with what MusterNotificationGatewayBroken carries of them: the public_id and the name.
func (*Queries) ListAlertingIntegrations ¶
func (q *Queries) ListAlertingIntegrations(ctx context.Context, orgID int64) ([]ListAlertingIntegrationsRow, error)
ListAlertingIntegrations lists the Integrations that are not deleted, the built-in one aside, with what the Internal alerts about an Integration carry of them: the public_id, the name and the Static labels.
func (*Queries) ListAlertingSchedules ¶
func (q *Queries) ListAlertingSchedules(ctx context.Context, orgID int64) ([]ListAlertingSchedulesRow, error)
ListAlertingSchedules lists the Schedules with what MusterScheduleGap carries of them: the public_id and the name, the public_id, the name and the slug of their Team, and the Organization's Team label, under which the slug goes.
func (*Queries) ListHeartbeatIntegrations ¶
func (q *Queries) ListHeartbeatIntegrations(ctx context.Context, orgID int64) ([]ListHeartbeatIntegrationsRow, error)
ListHeartbeatIntegrations lists the Integrations that are not deleted and have their Heartbeat on, with what MusterHeartbeatLost carries of them: the public_id, the name and the Static labels.
func (*Queries) ListOpenAlertGroupCounts ¶
func (q *Queries) ListOpenAlertGroupCounts(ctx context.Context, orgID int64) ([]ListOpenAlertGroupCountsRow, error)
ListOpenAlertGroupCounts counts the open Alert Groups of each Route that has any (Route.open_alert_group_count).
func (*Queries) ListPreviewDestinations ¶
func (q *Queries) ListPreviewDestinations(ctx context.Context, arg ListPreviewDestinationsParams) ([]ListPreviewDestinationsRow, error)
ListPreviewDestinations reads the Destinations that are not deleted among the ids with their names, types and health, for the preview "Where alerts go".
func (*Queries) ListPreviewTeamEntries ¶
func (q *Queries) ListPreviewTeamEntries(ctx context.Context, arg ListPreviewTeamEntriesParams) ([]ListPreviewTeamEntriesRow, error)
ListPreviewTeamEntries lists the Destination entries of the Teams whose Destinations are not deleted, as delivery reads them, for the preview "Where alerts go".
func (*Queries) ListPreviewTeams ¶
func (q *Queries) ListPreviewTeams(ctx context.Context, arg ListPreviewTeamsParams) ([]ListPreviewTeamsRow, error)
ListPreviewTeams reads the Teams that are not deleted among the ids with their names and slugs, for the Teams the preview "Where alerts go" names.
func (*Queries) ListRouteChains ¶
func (q *Queries) ListRouteChains(ctx context.Context, arg ListRouteChainsParams) ([]ListRouteChainsRow, error)
ListRouteChains lists the Escalation chains of the Routes with their Severity conditions and their owning Teams, by Route, then by public_id.
func (*Queries) ListRouteDestinationIDs ¶
func (q *Queries) ListRouteDestinationIDs(ctx context.Context, arg ListRouteDestinationIDsParams) ([]ListRouteDestinationIDsRow, error)
ListRouteDestinationIDs lists the Destinations that are not deleted of the Routes with their Severity conditions, by public_id.
func (*Queries) ListRouteInfo ¶
ListRouteInfo lists the Routes that are not deleted for muster_route_info.
func (*Queries) ListRouteLabelSuggestions ¶
func (q *Queries) ListRouteLabelSuggestions(ctx context.Context, arg ListRouteLabelSuggestionsParams) ([]ListRouteLabelSuggestionsRow, error)
ListRouteLabelSuggestions lists the labels of the Alerts of the Route's Alert Groups created since @since, each with its most frequent value, the smallest of equally frequent ones, and the number of those Alert Groups whose Alerts carry it, most frequent first, at most @lim, for "Labels in the message" (C-29.FR-2). What it reads is bounded before any label is expanded: the @group_lim most recent of those Alert Groups, through alert_groups_route_idx, then the memberships of one Alert Group after another, the most recent Alert Group and the newest membership first, through alert_group_alerts_group_idx, until @alert_lim of them are taken; the subquery r keeps the order of the Alert Groups known to the planner, so that the outer LIMIT stops the nested loop instead of sorting every membership. An Alert that fired again in an Alert Group, one membership per Episode, counts once there.
func (*Queries) ListRouteMatchers ¶
func (q *Queries) ListRouteMatchers(ctx context.Context, arg ListRouteMatchersParams) ([]ListRouteMatchersRow, error)
ListRouteMatchers lists the Matchers of the Routes, in their order.
func (*Queries) ListRouteSuggestionDismissals ¶
func (q *Queries) ListRouteSuggestionDismissals(ctx context.Context, arg ListRouteSuggestionDismissalsParams) ([]string, error)
ListRouteSuggestionDismissals lists the Route suggestions a User dismissed.
func (*Queries) ListRoutes ¶
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors ListRoutes lists the Routes that are not deleted in evaluation order, the Default route last, with their template error and their active Storm, and the Organization's severity and Team labels, from which a Route's "Labels in the message" are computed while it has no list of its own.
func (*Queries) ListTeamsOfDestination ¶
func (q *Queries) ListTeamsOfDestination(ctx context.Context, arg ListTeamsOfDestinationParams) ([]int64, error)
ListTeamsOfDestination lists, in id order, the Teams whose Destination entries name a Destination about to be deleted.
func (*Queries) ListUserTeams ¶
ListUserTeams lists the public_ids of the Teams that are not deleted and that the User is in: "My Teams".
func (*Queries) LockOwningTeam ¶
func (q *Queries) LockOwningTeam(ctx context.Context, arg LockOwningTeamParams) (LockOwningTeamRow, error)
LockOwningTeam reads the Team that is not deleted that a Route is to name as its owner, in share mode, so that the Team's deletion, which locks it for update, either waits for the save or is seen by it.
func (*Queries) LockRoute ¶
LockRoute locks a Route that is not deleted for a change; the lock leaves the key alone, so that routing, whose foreign key check on alerts.route_id takes a key share lock, never waits for it.
func (*Queries) LockRouteMembership ¶
func (q *Queries) LockRouteMembership(ctx context.Context, arg LockRouteMembershipParams) error
LockRouteMembership takes, until the transaction ends, the membership lock of a Route exclusively before its Destinations change: delivery's Enqueue takes it shared (ShareRouteMembership, class db.RouteMembershipLockClass), so that a change of the Destinations and an Enqueue on the Route serialize.
func (*Queries) LockTeamMembership ¶
func (q *Queries) LockTeamMembership(ctx context.Context, arg LockTeamMembershipParams) error
LockTeamMembership takes, until the transaction ends, the membership lock of a Team exclusively (class db.TeamMembershipLockClass) before the Team's Destination entries change: whatever reads them for an Alert Group takes it shared, so that the change and an Enqueue that reaches the Team's Destinations serialize.
func (*Queries) NotifyOpenGroupUpdates ¶
NotifyOpenGroupUpdates wakes the open Alert Group update workers of every replica once the transaction commits.
func (*Queries) ResetAlertTeams ¶
func (q *Queries) ResetAlertTeams(ctx context.Context, arg ResetAlertTeamsParams) error
ResetAlertTeams forgets the Teams of Alerts that start firing, which InsertAlertTeams then records anew, and records the value of the Team label that names no Team, empty for none; an Alert whose value stays the same is not written.
func (*Queries) ResolveDestinations ¶
func (q *Queries) ResolveDestinations(ctx context.Context, arg ResolveDestinationsParams) ([]ResolveDestinationsRow, error)
ResolveDestinations reads the Destinations that are not deleted among the public_ids, for the Destinations of a Route.
func (*Queries) ResolveRouteChains ¶
func (q *Queries) ResolveRouteChains(ctx context.Context, arg ResolveRouteChainsParams) ([]ResolveRouteChainsRow, error)
ResolveRouteChains reads the Escalation chains among the public_ids FOR KEY SHARE, for the chains of a Route: the deletion of a chain locks it FOR UPDATE and then reads the entries that name it, so it either sees this save's entry or this save waits and then finds the chain gone.
func (*Queries) RestampAlertRoutes ¶
func (q *Queries) RestampAlertRoutes(ctx context.Context, arg RestampAlertRoutesParams) error
RestampAlertRoutes records another Route for the current firing of Alerts: the Default route, for Alerts whose Route was deleted while their Snapshot waited for it.
func (*Queries) SetAlertRoutes ¶
func (q *Queries) SetAlertRoutes(ctx context.Context, arg SetAlertRoutesParams) error
SetAlertRoutes records the Route and the Severity level of the current firing of each Alert; a route id of 0 and an empty raw value are null.
func (*Queries) SetRouteDestinationConditions ¶
func (q *Queries) SetRouteDestinationConditions(ctx context.Context, arg SetRouteDestinationConditionsParams) error
SetRouteDestinationConditions changes the Severity conditions of Destinations a Route keeps, one each.
func (*Queries) SetRoutePositions ¶
func (q *Queries) SetRoutePositions(ctx context.Context, arg SetRoutePositionsParams) error
SetRoutePositions rewrites the positions of the Routes.
func (*Queries) ShareTeamEvaluation ¶
func (q *Queries) ShareTeamEvaluation(ctx context.Context, arg ShareTeamEvaluationParams) error
ShareTeamEvaluation takes the transaction advisory lock of the evaluation of the Teams (db.TeamEvaluationLockClass, keyed by the Organization) shared, before the Snapshot reads the stamp of the classification: the evaluation of a save takes it exclusively, so it waits for a Snapshot that classified with the Teams before the save.
func (*Queries) UpdateRoute ¶
func (q *Queries) UpdateRoute(ctx context.Context, arg UpdateRouteParams) error
UpdateRoute replaces the configured fields of a Route and bumps its version; urgent is written as minimum_severity = 'critical', which a 0.1 replica of a rolling update still reads (C-26.FR-10).
func (*Queries) UpsertRouteChains ¶
func (q *Queries) UpsertRouteChains(ctx context.Context, arg UpsertRouteChainsParams) error
UpsertRouteChains adds Escalation chains to a Route now with their Severity conditions, and changes the condition of those it has, which keep the time they were added.
type ResetAlertTeamsParams ¶
type ResolveDestinationsRow ¶
type ResolveRouteChainsRow ¶
type SetAlertRoutesParams ¶
type SetRoutePositionsParams ¶
type ShareTeamEvaluationParams ¶
type ShareTeamEvaluationParams struct {
}
type UpdateRouteParams ¶
type UpdateRouteParams struct {
Name string
Description string
MinimumSeverity string
GroupKey []string
ReopenWindowSeconds int64
GracePeriodSeconds int64
UrgentRiseRemovesAck bool
SnoozeDurationsSeconds []int64
ThreadBatchingWindowSeconds int64
StormThreshold int64
Language string
TemplateRootMessage pgtype.Text
TemplateLine pgtype.Text
TemplateAckTimeoutNotice pgtype.Text
AckTimeoutEnabled bool
AckTimeoutFirstIntervalSeconds int64
RemindersEnabled bool
RemindersFirstIntervalSeconds int64
RemindersCapSeconds int64
AutoUnacknowledge bool
OwningTeamID pgtype.Int8
MessageLabels []string
DeliverToTeams bool
RunTeamChains bool
ManagedBy pgtype.Text
Now time.Time
OrgID int64
ID int64
}