Documentation
¶
Index ¶
- type DBTX
- type DeleteLinkRuleMatchersParams
- type DeleteLinkRuleParams
- type DeleteLookupEntriesParams
- type DeleteLookupTableParams
- type EnsureExploreRuleParams
- type EnsureExploreRuleRow
- type GetLinkGroupParams
- type GetLinkGroupRow
- type GetLinkRuleParams
- type GetLinkRuleRow
- type GetLookupCellsParams
- type GetLookupTableParams
- type GetLookupTableRow
- type InsertLinkRuleMatcherParams
- type InsertLinkRuleParams
- type InsertLinksUpdateParams
- type InsertLookupEntriesParams
- type InsertLookupTableParams
- type ListLinkAlertsParams
- type ListLinkAlertsRow
- type ListLinkRuleMatchersParams
- type ListLinkRuleMatchersRow
- type ListLinkRuleTemplatesRow
- type ListLinkRulesParams
- type ListLinkRulesRow
- type ListLookupEntriesParams
- type ListLookupEntriesRow
- type ListLookupTablesParams
- type ListLookupTablesRow
- type ListRecentSnapshotsParams
- type LockLinkRuleParams
- type LockLinkRulesParams
- type LockLookupTableParams
- type Queries
- func (q *Queries) DeleteLinkRule(ctx context.Context, arg DeleteLinkRuleParams) error
- func (q *Queries) DeleteLinkRuleMatchers(ctx context.Context, arg DeleteLinkRuleMatchersParams) error
- func (q *Queries) DeleteLookupEntries(ctx context.Context, arg DeleteLookupEntriesParams) error
- func (q *Queries) DeleteLookupTable(ctx context.Context, arg DeleteLookupTableParams) error
- func (q *Queries) EnsureExploreRule(ctx context.Context, arg EnsureExploreRuleParams) (EnsureExploreRuleRow, error)
- func (q *Queries) GetLinkGroup(ctx context.Context, arg GetLinkGroupParams) (GetLinkGroupRow, error)
- func (q *Queries) GetLinkRule(ctx context.Context, arg GetLinkRuleParams) (GetLinkRuleRow, error)
- func (q *Queries) GetLinkSnapshotRetention(ctx context.Context, orgID int64) (int64, error)
- func (q *Queries) GetLookupCells(ctx context.Context, arg GetLookupCellsParams) ([]byte, error)
- func (q *Queries) GetLookupTable(ctx context.Context, arg GetLookupTableParams) (GetLookupTableRow, error)
- func (q *Queries) InsertLinkRule(ctx context.Context, arg InsertLinkRuleParams) (int64, error)
- func (q *Queries) InsertLinkRuleMatcher(ctx context.Context, arg InsertLinkRuleMatcherParams) error
- func (q *Queries) InsertLinksUpdate(ctx context.Context, arg InsertLinksUpdateParams) error
- func (q *Queries) InsertLookupEntries(ctx context.Context, arg InsertLookupEntriesParams) error
- func (q *Queries) InsertLookupTable(ctx context.Context, arg InsertLookupTableParams) (int64, error)
- func (q *Queries) ListLinkAlerts(ctx context.Context, arg ListLinkAlertsParams) ([]ListLinkAlertsRow, error)
- func (q *Queries) ListLinkRuleMatchers(ctx context.Context, arg ListLinkRuleMatchersParams) ([]ListLinkRuleMatchersRow, error)
- func (q *Queries) ListLinkRuleTemplates(ctx context.Context, orgID int64) ([]ListLinkRuleTemplatesRow, error)
- func (q *Queries) ListLinkRules(ctx context.Context, arg ListLinkRulesParams) ([]ListLinkRulesRow, error)
- func (q *Queries) ListLookupEntries(ctx context.Context, arg ListLookupEntriesParams) ([]ListLookupEntriesRow, error)
- func (q *Queries) ListLookupTables(ctx context.Context, arg ListLookupTablesParams) ([]ListLookupTablesRow, error)
- func (q *Queries) ListRecentSnapshots(ctx context.Context, arg ListRecentSnapshotsParams) ([][]byte, error)
- func (q *Queries) LockLinkRule(ctx context.Context, arg LockLinkRuleParams) (int64, error)
- func (q *Queries) LockLinkRules(ctx context.Context, arg LockLinkRulesParams) error
- func (q *Queries) LockLookupTable(ctx context.Context, arg LockLookupTableParams) (int64, error)
- func (q *Queries) NotifyOpenGroupUpdates(ctx context.Context, channel string) error
- func (q *Queries) UpdateLinkRule(ctx context.Context, arg UpdateLinkRuleParams) error
- func (q *Queries) UpdateLookupTable(ctx context.Context, arg UpdateLookupTableParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type UpdateLinkRuleParams
- type UpdateLookupTableParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteLinkRuleParams ¶
type DeleteLookupTableParams ¶
type EnsureExploreRuleParams ¶
type EnsureExploreRuleRow ¶
type GetLinkGroupParams ¶
type GetLinkGroupRow ¶
type GetLinkGroupRow struct {
ID int64
PublicID string
Number int64
Title string
Summary pgtype.Text
Status string
SeverityLevel string
Urgent bool
GroupKeyValues []byte
CommonLabels []byte
CommonAnnotations []byte
ReopenCount int64
CreatedAt time.Time
RoutePublicID string
RouteName string
TimeZone string
OwnerName string
}
type GetLinkRuleParams ¶
type GetLinkRuleRow ¶
type GetLookupCellsParams ¶
type GetLookupTableParams ¶
type GetLookupTableRow ¶
type InsertLinkRuleParams ¶
type InsertLinksUpdateParams ¶
type InsertLookupTableParams ¶
type ListLinkAlertsParams ¶
type ListLinkAlertsRow ¶
type ListLinkRuleMatchersRow ¶
type ListLinkRulesParams ¶
type ListLinkRulesRow ¶
type ListLookupEntriesParams ¶
type ListLookupEntriesRow ¶
type ListLookupTablesParams ¶
type ListLookupTablesRow ¶
type LockLinkRuleParams ¶
type LockLinkRulesParams ¶
type LockLookupTableParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteLinkRule ¶
func (q *Queries) DeleteLinkRule(ctx context.Context, arg DeleteLinkRuleParams) error
DeleteLinkRule deletes a Link rule that is not the built-in one, with its Matchers.
func (*Queries) DeleteLinkRuleMatchers ¶
func (q *Queries) DeleteLinkRuleMatchers(ctx context.Context, arg DeleteLinkRuleMatchersParams) error
DeleteLinkRuleMatchers deletes the Matchers of a Link rule, which an update writes again.
func (*Queries) DeleteLookupEntries ¶
func (q *Queries) DeleteLookupEntries(ctx context.Context, arg DeleteLookupEntriesParams) error
DeleteLookupEntries deletes every row of a Lookup table, which the rows of an update replace.
func (*Queries) DeleteLookupTable ¶
func (q *Queries) DeleteLookupTable(ctx context.Context, arg DeleteLookupTableParams) error
DeleteLookupTable deletes a Lookup table with its rows.
func (*Queries) EnsureExploreRule ¶
func (q *Queries) EnsureExploreRule(ctx context.Context, arg EnsureExploreRuleParams) (EnsureExploreRuleRow, error)
EnsureExploreRule creates the built-in "Explore" rule of the Organization unless it has one, and gives an existing one the URL template while it still has one of the previous built-in templates; it returns no row when the rule exists and keeps its template, and updated true when it gave an existing rule the new template (xmax is set only on the row an ON CONFLICT update wrote).
func (*Queries) GetLinkGroup ¶
func (q *Queries) GetLinkGroup(ctx context.Context, arg GetLinkGroupParams) (GetLinkGroupRow, error)
GetLinkGroup reads what the links of an Alert Group are computed from: the Alert Group, its Route, the Organization's time zone and its Owner's name.
func (*Queries) GetLinkRule ¶
func (q *Queries) GetLinkRule(ctx context.Context, arg GetLinkRuleParams) (GetLinkRuleRow, error)
GetLinkRule reads a Link rule by public_id.
func (*Queries) GetLinkSnapshotRetention ¶
GetLinkSnapshotRetention reads retention.stored_snapshots in days.
func (*Queries) GetLookupCells ¶
GetLookupCells reads the cells of one row of the Lookup table named name, for `lookup`.
func (*Queries) GetLookupTable ¶
func (q *Queries) GetLookupTable(ctx context.Context, arg GetLookupTableParams) (GetLookupTableRow, error)
GetLookupTable reads a Lookup table by public_id.
func (*Queries) InsertLinkRule ¶
InsertLinkRule creates a Link rule; the unique name is checked by its constraint.
func (*Queries) InsertLinkRuleMatcher ¶
func (q *Queries) InsertLinkRuleMatcher(ctx context.Context, arg InsertLinkRuleMatcherParams) error
InsertLinkRuleMatcher writes one Matcher of a Link rule at its position.
func (*Queries) InsertLinksUpdate ¶
func (q *Queries) InsertLinksUpdate(ctx context.Context, arg InsertLinksUpdateParams) error
InsertLinksUpdate requests that a change of a Link rule or of a Lookup table reach the open Root messages, whose links it may change (C-12.FR-9), with a row organization_links without a scope; the open_group_updates worker of any replica claims it and re-renders every open Alert Group of the Organization. A row organization_links that no worker has claimed yet already covers the change, since its run computes the links with the rules and tables as they are then: it is locked, so that no worker claims it before this transaction commits, and no second one is inserted.
func (*Queries) InsertLookupEntries ¶
func (q *Queries) InsertLookupEntries(ctx context.Context, arg InsertLookupEntriesParams) error
InsertLookupEntries writes rows of a Lookup table: keys[i] with cells[i].
func (*Queries) InsertLookupTable ¶
func (q *Queries) InsertLookupTable(ctx context.Context, arg InsertLookupTableParams) (int64, error)
InsertLookupTable creates a Lookup table; the unique name is checked by its constraint.
func (*Queries) ListLinkAlerts ¶
func (q *Queries) ListLinkAlerts(ctx context.Context, arg ListLinkAlertsParams) ([]ListLinkAlertsRow, error)
ListLinkAlerts lists the Alerts of an Alert Group that its messages show, firing first and newest first, at most lim of them.
func (*Queries) ListLinkRuleMatchers ¶
func (q *Queries) ListLinkRuleMatchers(ctx context.Context, arg ListLinkRuleMatchersParams) ([]ListLinkRuleMatchersRow, error)
ListLinkRuleMatchers lists the Matchers of the Link rules, in their order.
func (*Queries) ListLinkRuleTemplates ¶
func (q *Queries) ListLinkRuleTemplates(ctx context.Context, orgID int64) ([]ListLinkRuleTemplatesRow, error)
ListLinkRuleTemplates lists the names and URL templates of every Link rule, for the use of a Lookup table.
func (*Queries) ListLinkRules ¶
func (q *Queries) ListLinkRules(ctx context.Context, arg ListLinkRulesParams) ([]ListLinkRulesRow, error)
ListLinkRules lists a page of the Link rules in the order they were created, after the id after_id.
func (*Queries) ListLookupEntries ¶
func (q *Queries) ListLookupEntries(ctx context.Context, arg ListLookupEntriesParams) ([]ListLookupEntriesRow, error)
ListLookupEntries lists the rows of the Lookup tables, by key.
func (*Queries) ListLookupTables ¶
func (q *Queries) ListLookupTables(ctx context.Context, arg ListLookupTablesParams) ([]ListLookupTablesRow, error)
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors Links (C-12.FR-9): Lookup tables with their rows, Link rules with their Matchers, the cells `lookup` reads, the samples of a Link rule's dry run, and the Alert Group whose links getAlertGroup computes on read. ListLookupTables lists a page of the Lookup tables in the order they were created, after the id after_id.
func (*Queries) ListRecentSnapshots ¶
func (q *Queries) ListRecentSnapshots(ctx context.Context, arg ListRecentSnapshotsParams) ([][]byte, error)
ListRecentSnapshots lists the bodies of the most recent processed Alertmanager Stored Snapshots of the Organization within the retention of Stored Snapshots, newest first, for the dry run of a Link rule.
func (*Queries) LockLinkRule ¶
LockLinkRule locks a Link rule by public_id for a change.
func (*Queries) LockLinkRules ¶
func (q *Queries) LockLinkRules(ctx context.Context, arg LockLinkRulesParams) error
LockLinkRules takes the transaction advisory lock of the changes of the Link rules and Lookup tables of the Organization (db.LinkRulesLockClass, keyed by the Organization) exclusively, until the end of the transaction.
func (*Queries) LockLookupTable ¶
LockLookupTable locks a Lookup table by public_id for a change.
func (*Queries) NotifyOpenGroupUpdates ¶
NotifyOpenGroupUpdates wakes the open Alert Group update workers of every replica once the transaction commits.
func (*Queries) UpdateLinkRule ¶
func (q *Queries) UpdateLinkRule(ctx context.Context, arg UpdateLinkRuleParams) error
UpdateLinkRule replaces the fields of a Link rule and bumps its version.
func (*Queries) UpdateLookupTable ¶
func (q *Queries) UpdateLookupTable(ctx context.Context, arg UpdateLookupTableParams) error
UpdateLookupTable replaces the fields of a Lookup table and bumps its version.