Documentation
¶
Index ¶
- type CountGenerationRunsParams
- type CountGenerationRunsRow
- type DBTX
- type DeleteChainParams
- type DeleteRunTimersParams
- type DeleteStepsParams
- type GetChainIDParams
- type GetChainParams
- type GetChainRow
- type GetOrganizationWorkingHoursRow
- type GetRunGroupParams
- type GetStepDestinationParams
- type GetStepDestinationRow
- type GetTeamIDParams
- type GetTeamWorkingHoursParams
- type GetTeamWorkingHoursRow
- type InsertChainParams
- type InsertRunParams
- type InsertRunStepParams
- type InsertStepParams
- type InsertStepUsersParams
- type ListChainDestinationsParams
- type ListChainDestinationsRow
- type ListChainInfoRow
- type ListChainRunsParams
- type ListChainRunsRow
- type ListChainSourcesParams
- type ListChainSourcesRow
- type ListChainsParams
- type ListChainsRow
- type ListGatewaysRow
- type ListGenerationRunsParams
- type ListGenerationRunsRow
- type ListGroupRunsParams
- type ListGroupRunsRow
- type ListPeopleStatesParams
- type ListPeopleStatesRow
- type ListRouteReferrersParams
- type ListRouteReferrersRow
- type ListRunPagesParams
- type ListRunPagesRow
- type ListRunStepsParams
- type ListRunStepsRow
- type ListStepUsersParams
- type ListStepUsersRow
- type ListStepsParams
- type ListStepsRow
- type ListTeamReferrersParams
- type ListTeamReferrersRow
- type ListTeamRefsParams
- type ListTeamRefsRow
- type ListUserTeamsParams
- type LockChainForDeletionParams
- type LockChainParams
- type LockOwningTeamParams
- type LockOwningTeamRow
- type LockRunParams
- type LockRunRow
- type Queries
- func (q *Queries) CountGenerationRuns(ctx context.Context, arg CountGenerationRunsParams) (CountGenerationRunsRow, error)
- func (q *Queries) DeleteChain(ctx context.Context, arg DeleteChainParams) error
- func (q *Queries) DeleteRunTimers(ctx context.Context, arg DeleteRunTimersParams) error
- func (q *Queries) DeleteSteps(ctx context.Context, arg DeleteStepsParams) error
- func (q *Queries) GetChain(ctx context.Context, arg GetChainParams) (GetChainRow, error)
- func (q *Queries) GetChainID(ctx context.Context, arg GetChainIDParams) (int64, error)
- func (q *Queries) GetOrganizationWorkingHours(ctx context.Context, orgID int64) (GetOrganizationWorkingHoursRow, error)
- func (q *Queries) GetRunGroup(ctx context.Context, arg GetRunGroupParams) (int64, error)
- func (q *Queries) GetStepDestination(ctx context.Context, arg GetStepDestinationParams) (GetStepDestinationRow, error)
- func (q *Queries) GetTeamID(ctx context.Context, arg GetTeamIDParams) (int64, error)
- func (q *Queries) GetTeamWorkingHours(ctx context.Context, arg GetTeamWorkingHoursParams) (GetTeamWorkingHoursRow, error)
- func (q *Queries) InsertChain(ctx context.Context, arg InsertChainParams) (int64, error)
- func (q *Queries) InsertRun(ctx context.Context, arg InsertRunParams) (int64, error)
- func (q *Queries) InsertRunStep(ctx context.Context, arg InsertRunStepParams) error
- func (q *Queries) InsertStep(ctx context.Context, arg InsertStepParams) (int64, error)
- func (q *Queries) InsertStepUsers(ctx context.Context, arg InsertStepUsersParams) error
- func (q *Queries) ListChainDestinations(ctx context.Context, arg ListChainDestinationsParams) ([]ListChainDestinationsRow, error)
- func (q *Queries) ListChainInfo(ctx context.Context, orgID int64) ([]ListChainInfoRow, error)
- func (q *Queries) ListChainRuns(ctx context.Context, arg ListChainRunsParams) ([]ListChainRunsRow, error)
- func (q *Queries) ListChainSources(ctx context.Context, arg ListChainSourcesParams) ([]ListChainSourcesRow, error)
- func (q *Queries) ListChains(ctx context.Context, arg ListChainsParams) ([]ListChainsRow, error)
- func (q *Queries) ListGateways(ctx context.Context, orgID int64) ([]ListGatewaysRow, error)
- func (q *Queries) ListGenerationRuns(ctx context.Context, arg ListGenerationRunsParams) ([]ListGenerationRunsRow, error)
- func (q *Queries) ListGroupRuns(ctx context.Context, arg ListGroupRunsParams) ([]ListGroupRunsRow, error)
- func (q *Queries) ListPeopleStates(ctx context.Context, arg ListPeopleStatesParams) ([]ListPeopleStatesRow, error)
- func (q *Queries) ListRouteReferrers(ctx context.Context, arg ListRouteReferrersParams) ([]ListRouteReferrersRow, error)
- func (q *Queries) ListRunPages(ctx context.Context, arg ListRunPagesParams) ([]ListRunPagesRow, error)
- func (q *Queries) ListRunSteps(ctx context.Context, arg ListRunStepsParams) ([]ListRunStepsRow, error)
- func (q *Queries) ListStepUsers(ctx context.Context, arg ListStepUsersParams) ([]ListStepUsersRow, error)
- func (q *Queries) ListSteps(ctx context.Context, arg ListStepsParams) ([]ListStepsRow, error)
- func (q *Queries) ListTeamReferrers(ctx context.Context, arg ListTeamReferrersParams) ([]ListTeamReferrersRow, error)
- func (q *Queries) ListTeamRefs(ctx context.Context, arg ListTeamRefsParams) ([]ListTeamRefsRow, error)
- func (q *Queries) ListUserTeams(ctx context.Context, arg ListUserTeamsParams) ([]int64, error)
- func (q *Queries) LockChain(ctx context.Context, arg LockChainParams) (int64, error)
- func (q *Queries) LockChainForDeletion(ctx context.Context, arg LockChainForDeletionParams) (int64, error)
- func (q *Queries) LockOwningTeam(ctx context.Context, arg LockOwningTeamParams) (LockOwningTeamRow, error)
- func (q *Queries) LockRun(ctx context.Context, arg LockRunParams) (LockRunRow, error)
- func (q *Queries) NotifyRunTimers(ctx context.Context, channel string) error
- func (q *Queries) ResolveDestinations(ctx context.Context, arg ResolveDestinationsParams) ([]ResolveDestinationsRow, error)
- func (q *Queries) ResolveSchedules(ctx context.Context, arg ResolveSchedulesParams) ([]ResolveSchedulesRow, error)
- func (q *Queries) ResolveTeams(ctx context.Context, arg ResolveTeamsParams) ([]ResolveTeamsRow, error)
- func (q *Queries) ResolveUsers(ctx context.Context, arg ResolveUsersParams) ([]ResolveUsersRow, error)
- func (q *Queries) SaveRun(ctx context.Context, arg SaveRunParams) error
- func (q *Queries) SetRunSources(ctx context.Context, arg SetRunSourcesParams) error
- func (q *Queries) ShareChains(ctx context.Context, arg ShareChainsParams) ([]ShareChainsRow, error)
- func (q *Queries) SnapshotSteps(ctx context.Context, arg SnapshotStepsParams) ([]SnapshotStepsRow, error)
- func (q *Queries) StopRuns(ctx context.Context, arg StopRunsParams) ([]StopRunsRow, error)
- func (q *Queries) UpdateChain(ctx context.Context, arg UpdateChainParams) error
- func (q *Queries) UpsertRunTimer(ctx context.Context, arg UpsertRunTimerParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResolveDestinationsParams
- type ResolveDestinationsRow
- type ResolveSchedulesParams
- type ResolveSchedulesRow
- type ResolveTeamsParams
- type ResolveTeamsRow
- type ResolveUsersParams
- type ResolveUsersRow
- type SaveRunParams
- type SetRunSourcesParams
- type ShareChainsParams
- type ShareChainsRow
- type SnapshotStepsParams
- type SnapshotStepsRow
- type StopRunsParams
- type StopRunsRow
- type UpdateChainParams
- type UpsertRunTimerParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountGenerationRunsRow ¶
type DeleteChainParams ¶
type DeleteRunTimersParams ¶
type DeleteStepsParams ¶
type GetChainIDParams ¶
type GetChainParams ¶
type GetChainRow ¶
type GetRunGroupParams ¶
type GetStepDestinationRow ¶
type GetTeamIDParams ¶
type GetTeamWorkingHoursRow ¶
type InsertChainParams ¶
type InsertRunParams ¶
type InsertRunStepParams ¶
type InsertStepParams ¶
type InsertStepParams struct {
OrgID int64
ChainID int64
Position int32
Kind string
Importance pgtype.Text
ScheduleID pgtype.Int8
TeamID pgtype.Int8
Everyone pgtype.Text
CallTarget pgtype.Text
GatewayConnectionID pgtype.Int8
WaitSeconds pgtype.Int4
DestinationID pgtype.Int8
RepeatFrom pgtype.Int4
RepeatTimes pgtype.Int4
WorkingHoursOnly bool
SeverityCondition string
}
type InsertStepUsersParams ¶
type ListChainInfoRow ¶
type ListChainRunsParams ¶
type ListChainRunsRow ¶
type ListChainRunsRow struct {
ID int64
PublicID string
State string
StartedAt time.Time
EndedAt pgtype.Timestamptz
StopCommand pgtype.Text
GroupPublicID string
GroupNumber int64
GroupTitle string
GroupSeverity string
GroupResolvedAt pgtype.Timestamptz
RetentionAlertDetailsDays int64
ActorKind string
UserPublicID pgtype.Text
UserName pgtype.Text
UserLogin pgtype.Text
UserDeleted bool
ServiceAccountPublicID pgtype.Text
ServiceAccountName pgtype.Text
ServiceAccountDeleted bool
}
type ListChainSourcesParams ¶
type ListChainSourcesRow ¶
type ListChainsParams ¶
type ListChainsRow ¶
type ListGatewaysRow ¶
type ListGenerationRunsRow ¶
type ListGroupRunsParams ¶
type ListGroupRunsRow ¶
type ListGroupRunsRow struct {
GroupPublicID string
ID int64
PublicID string
ChainID pgtype.Int8
ChainName string
Sources []byte
Steps []byte
StepIndex int32
State string
StartedAt time.Time
ChainPublicID pgtype.Text
CurrentChainName pgtype.Text
TeamPublicID pgtype.Text
TeamName pgtype.Text
TeamSlug pgtype.Text
TeamDeleted bool
Deadline time.Time
}
type ListPeopleStatesParams ¶
type ListPeopleStatesRow ¶
type ListRouteReferrersRow ¶
type ListRunPagesParams ¶
type ListRunPagesRow ¶
type ListRunPagesRow struct {
ID int64
RunID int64
StepNumber int32
RunStepSeq pgtype.Int4
StepAt time.Time
Kind string
Everyone pgtype.Text
State string
Reason pgtype.Text
CreatedAt time.Time
TeamPublicID pgtype.Text
TeamName pgtype.Text
TeamSlug pgtype.Text
TeamDeleted bool
GatewayPublicID pgtype.Text
GatewayName pgtype.Text
UserPublicID pgtype.Text
UserName pgtype.Text
UserLogin pgtype.Text
UserStatus pgtype.Text
}
type ListRunStepsParams ¶
type ListRunStepsRow ¶
type ListStepUsersParams ¶
type ListStepUsersRow ¶
type ListStepsParams ¶
type ListStepsRow ¶
type ListStepsRow struct {
ID int64
ChainID int64
Position int32
Kind string
Importance pgtype.Text
Everyone pgtype.Text
CallTarget pgtype.Text
WaitSeconds pgtype.Int4
RepeatFrom pgtype.Int4
RepeatTimes pgtype.Int4
WorkingHoursOnly bool
SeverityCondition string
SchedulePublicID pgtype.Text
ScheduleName pgtype.Text
ScheduleTeamPublicID pgtype.Text
ScheduleTeamName pgtype.Text
ScheduleTeamSlug pgtype.Text
ScheduleTeamDeleted bool
TeamPublicID pgtype.Text
TeamName pgtype.Text
TeamSlug pgtype.Text
TeamDeleted bool
GatewayPublicID pgtype.Text
GatewayName pgtype.Text
GatewayLive bool
DestinationPublicID pgtype.Text
DestinationName pgtype.Text
DestinationType pgtype.Text
DestinationMode pgtype.Text
DestinationDeleted bool
}
type ListTeamReferrersParams ¶
type ListTeamReferrersRow ¶
type ListTeamRefsParams ¶
type ListTeamRefsRow ¶
type ListUserTeamsParams ¶
type LockChainParams ¶
type LockOwningTeamParams ¶
type LockOwningTeamRow ¶
type LockRunParams ¶
type LockRunRow ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountGenerationRuns ¶
func (q *Queries) CountGenerationRuns(ctx context.Context, arg CountGenerationRunsParams) (CountGenerationRunsRow, error)
CountGenerationRuns counts the runs of an Alert Group in a start of its chains: all of them, those that ran out and those stopped.
func (*Queries) DeleteChain ¶
func (q *Queries) DeleteChain(ctx context.Context, arg DeleteChainParams) error
DeleteChain deletes a chain; its steps, their people and the entries of deleted Routes go with it.
func (*Queries) DeleteRunTimers ¶
func (q *Queries) DeleteRunTimers(ctx context.Context, arg DeleteRunTimersParams) error
DeleteRunTimers deletes the timers of the runs.
func (*Queries) DeleteSteps ¶
func (q *Queries) DeleteSteps(ctx context.Context, arg DeleteStepsParams) error
DeleteSteps deletes the steps of a chain with their people, before a save writes them again.
func (*Queries) GetChain ¶
func (q *Queries) GetChain(ctx context.Context, arg GetChainParams) (GetChainRow, error)
GetChain reads a chain with its owning Team.
func (*Queries) GetChainID ¶
GetChainID reads the id of a chain by public_id.
func (*Queries) GetOrganizationWorkingHours ¶
func (q *Queries) GetOrganizationWorkingHours(ctx context.Context, orgID int64) (GetOrganizationWorkingHoursRow, error)
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors Escalation chains (C-32): the chains with their steps and the people of their steps, what the steps name, the Routes and Teams that name a chain and the Destinations a chain writes in. GetOrganizationWorkingHours reads the Organization's Working hours, which the steps of a chain without an owning Team, or whose Team has none of its own, use.
func (*Queries) GetRunGroup ¶
GetRunGroup reads the Alert Group of a run, which the step of its timer locks first.
func (*Queries) GetStepDestination ¶
func (q *Queries) GetStepDestination(ctx context.Context, arg GetStepDestinationParams) (GetStepDestinationRow, error)
GetStepDestination reads the Destination of a webhook step with its type and mode, deleted or not. It takes no lock: locking the Destination after the Alert Group would close cycles with the delivery worker, which locks deliveries before it updates a Destination's health, and with a Team save, which locks Destinations by id.
func (*Queries) GetTeamID ¶
GetTeamID reads the id of a Team that is not deleted, for the filter by Team.
func (*Queries) GetTeamWorkingHours ¶
func (q *Queries) GetTeamWorkingHours(ctx context.Context, arg GetTeamWorkingHoursParams) (GetTeamWorkingHoursRow, error)
GetTeamWorkingHours reads the own Working hours of a Team, deleted ones included.
func (*Queries) InsertChain ¶
InsertChain creates a chain.
func (*Queries) InsertRun ¶
InsertRun starts a run of a chain on an Alert Group at its first step, with the chain's name and owning Team.
func (*Queries) InsertRunStep ¶
func (q *Queries) InsertRunStep(ctx context.Context, arg InsertRunStepParams) error
InsertRunStep records a step a run made or skipped, numbered after the run's last one.
func (*Queries) InsertStep ¶
InsertStep writes one step of a chain.
func (*Queries) InsertStepUsers ¶
func (q *Queries) InsertStepUsers(ctx context.Context, arg InsertStepUsersParams) error
InsertStepUsers writes the people of a step in their order.
func (*Queries) ListChainDestinations ¶
func (q *Queries) ListChainDestinations(ctx context.Context, arg ListChainDestinationsParams) ([]ListChainDestinationsRow, error)
ListChainDestinations lists, for each chain, the Destinations that are not deleted where it writes (C-32.FR-8): those of the Routes and of the Teams that are not deleted and name it, each once, by name, with their health and what their Connection can mention, none for an outgoing webhook or a deleted Connection. What a Connection can mention mirrors internal/mentions/query.sql GetMentionConnection; change both together.
func (*Queries) ListChainInfo ¶
ListChainInfo lists every chain for muster_escalation_chain_info.
func (*Queries) ListChainRuns ¶
func (q *Queries) ListChainRuns(ctx context.Context, arg ListChainRunsParams) ([]ListChainRunsRow, error)
ListChainRuns reads a page of the runs of a chain, newest first, after a position, with their Alert Groups — with when they resolved and retention.alert_details, which decide whether their details are removed — and what stopped them: the Command and its actor, from the lifecycle event that stopped them.
func (*Queries) ListChainSources ¶
func (q *Queries) ListChainSources(ctx context.Context, arg ListChainSourcesParams) ([]ListChainSourcesRow, error)
The runs of Escalation chains on Alert Groups (C-32.FR-4 to FR-7, FR-14 to FR-16, FR-18). Every statement below runs in the dispatcher's transaction, after the Alert Group's lock (Lock order of runs.go). ListChainSources lists the chains that may run on an Alert Group, each by the source that names it: its Route's, and, where the Route delivers to the Teams and runs their chains, those of the Teams of the Alert Group that are not deleted, each with its Severity condition.
func (*Queries) ListChains ¶
func (q *Queries) ListChains(ctx context.Context, arg ListChainsParams) ([]ListChainsRow, error)
ListChains reads a page of the chains by name, after a cursor, with their owning Teams; @q matches the name ignoring case, and @team_ids, when given, keeps the chains those Teams own.
func (*Queries) ListGateways ¶
ListGateways lists every Bridge Connection, deleted ones included, which a call step may name, with whether it is a Notification gateway now — not deleted, its info declaring the role gateway — by name. The condition mirrors internal/gateways/query.sql ListGateways; change both together.
func (*Queries) ListGenerationRuns ¶
func (q *Queries) ListGenerationRuns(ctx context.Context, arg ListGenerationRunsParams) ([]ListGenerationRunsRow, error)
ListGenerationRuns lists the runs of an Alert Group in a start of its chains.
func (*Queries) ListGroupRuns ¶
func (q *Queries) ListGroupRuns(ctx context.Context, arg ListGroupRunsParams) ([]ListGroupRunsRow, error)
ListGroupRuns reads the runs of Alert Groups, by public_id, in the current start of their chains (alert_groups.chain_generation), with their chains, owning Teams and the deadline of their timers, the zero time 0001-01-01 for none.
func (*Queries) ListPeopleStates ¶
func (q *Queries) ListPeopleStates(ctx context.Context, arg ListPeopleStatesParams) ([]ListPeopleStatesRow, error)
ListPeopleStates reads the Role and status of the people a step names, deleted ones included.
func (*Queries) ListRouteReferrers ¶
func (q *Queries) ListRouteReferrers(ctx context.Context, arg ListRouteReferrersParams) ([]ListRouteReferrersRow, error)
ListRouteReferrers lists the Routes that are not deleted and name the chains, with their Severity conditions, by name.
func (*Queries) ListRunPages ¶
func (q *Queries) ListRunPages(ctx context.Context, arg ListRunPagesParams) ([]ListRunPagesRow, error)
ListRunPages reads the Pages by Mention of the runs, in the order they were made, one row per person a Page names and one row with no person for a Page of a Team or of everyone in the chat (C-32.FR-18): each with the run step it belongs to — that of the rule run of a later Mention of a Notification rule, which the step that started it made, else its own; null for a Page or a rule run written before migration 0050 —, when that step was made at the latest — the start of the rule run of a later Mention or of a call action, else the Page's own time —, its Team, the Notification gateway of a call, deleted ones included, and its outcome: Pages by Mention and calls.
func (*Queries) ListRunSteps ¶
func (q *Queries) ListRunSteps(ctx context.Context, arg ListRunStepsParams) ([]ListRunStepsRow, error)
ListRunSteps reads the steps the runs made or skipped, in their order.
func (*Queries) ListStepUsers ¶
func (q *Queries) ListStepUsers(ctx context.Context, arg ListStepUsersParams) ([]ListStepUsersRow, error)
ListStepUsers lists the people of the steps in their order, deleted ones included.
func (*Queries) ListSteps ¶
func (q *Queries) ListSteps(ctx context.Context, arg ListStepsParams) ([]ListStepsRow, error)
ListSteps lists the steps of the chains in their order with what they name: the Schedule with its Team, the Team, the gateway's Connection with whether it is a Notification gateway now — not deleted, its info declaring the role gateway — and the Destination with its type, mode and whether it is deleted. The condition of a live gateway mirrors internal/gateways/query.sql ListGateways; change both together.
func (*Queries) ListTeamReferrers ¶
func (q *Queries) ListTeamReferrers(ctx context.Context, arg ListTeamReferrersParams) ([]ListTeamReferrersRow, error)
ListTeamReferrers lists the Teams that are not deleted and name the chains, with their Severity conditions, by name.
func (*Queries) ListTeamRefs ¶
func (q *Queries) ListTeamRefs(ctx context.Context, arg ListTeamRefsParams) ([]ListTeamRefsRow, error)
ListTeamRefs names Teams by id, deleted ones included.
func (*Queries) ListUserTeams ¶
ListUserTeams lists the Teams that are not deleted that a User is in, for the filter "My Teams".
func (*Queries) LockChain ¶
LockChain locks a chain for a change, FOR NO KEY UPDATE: the saves of Routes and Teams that name it take it FOR KEY SHARE and do not wait for a change of it.
func (*Queries) LockChainForDeletion ¶
func (q *Queries) LockChainForDeletion(ctx context.Context, arg LockChainForDeletionParams) (int64, error)
LockChainForDeletion locks a chain FOR UPDATE before its deletion, which conflicts with the FOR KEY SHARE of a save of a Route or a Team that names it: either that save committed and its entry refuses the deletion, or it waits and then finds the chain gone.
func (*Queries) LockOwningTeam ¶
func (q *Queries) LockOwningTeam(ctx context.Context, arg LockOwningTeamParams) (LockOwningTeamRow, error)
LockOwningTeam reads a Team that is not deleted as the owner of a chain FOR SHARE, before the chain's row: the deletion of the Team, which locks it first FOR NO KEY UPDATE and then reads the chains it owns, either sees the chain or makes this save wait and then find the Team deleted.
func (*Queries) LockRun ¶
func (q *Queries) LockRun(ctx context.Context, arg LockRunParams) (LockRunRow, error)
LockRun locks a run for its step, after its Alert Group, with the deadline of its timer — none, the zero time 0001-01-01, once it was stopped or replaced — the number of steps it made and skipped so far, and its sources, which say where its Pages go.
func (*Queries) NotifyRunTimers ¶
NotifyRunTimers wakes the timer workers of every replica once the transaction commits.
func (*Queries) ResolveDestinations ¶
func (q *Queries) ResolveDestinations(ctx context.Context, arg ResolveDestinationsParams) ([]ResolveDestinationsRow, error)
ResolveDestinations reads the Destinations among the public_ids with their type and mode, deleted ones included.
func (*Queries) ResolveSchedules ¶
func (q *Queries) ResolveSchedules(ctx context.Context, arg ResolveSchedulesParams) ([]ResolveSchedulesRow, error)
ResolveSchedules reads the Schedules among the public_ids with their Teams, FOR KEY SHARE in id order: the deletion of a Schedule locks it FOR UPDATE and then reads the steps that name it, so either it sees this save's step or this save waits and then finds the Schedule gone. KEY SHARE, unlike SHARE, does not conflict with the NO KEY UPDATE of a change of a Schedule, so a save naming two Schedules never deadlocks with making one of them main.
func (*Queries) ResolveTeams ¶
func (q *Queries) ResolveTeams(ctx context.Context, arg ResolveTeamsParams) ([]ResolveTeamsRow, error)
ResolveTeams reads the Teams among the public_ids, deleted ones included.
func (*Queries) ResolveUsers ¶
func (q *Queries) ResolveUsers(ctx context.Context, arg ResolveUsersParams) ([]ResolveUsersRow, error)
ResolveUsers reads the Users among the public_ids with their Role and status, deleted ones included.
func (*Queries) SaveRun ¶
func (q *Queries) SaveRun(ctx context.Context, arg SaveRunParams) error
SaveRun writes where a run is after its steps.
func (*Queries) SetRunSources ¶
func (q *Queries) SetRunSources(ctx context.Context, arg SetRunSourcesParams) error
SetRunSources writes the sources of a run that another source now names too (P-70).
func (*Queries) ShareChains ¶
func (q *Queries) ShareChains(ctx context.Context, arg ShareChainsParams) ([]ShareChainsRow, error)
ShareChains reads the chains a start runs FOR KEY SHARE in id order, before any run is written: the deletion of a chain locks it FOR UPDATE first and waits, or has deleted it and the start finds it gone.
func (*Queries) SnapshotSteps ¶
func (q *Queries) SnapshotSteps(ctx context.Context, arg SnapshotStepsParams) ([]SnapshotStepsRow, error)
SnapshotSteps reads the steps of the chains with the people of each, in one statement, so that a run takes the steps of one version of its chain (P-73).
func (*Queries) StopRuns ¶
func (q *Queries) StopRuns(ctx context.Context, arg StopRunsParams) ([]StopRunsRow, error)
StopRuns stops the running runs of an Alert Group with what stopped them; runs that ran out stay as they are.
func (*Queries) UpdateChain ¶
func (q *Queries) UpdateChain(ctx context.Context, arg UpdateChainParams) error
UpdateChain replaces the fields of a chain and bumps its version.
func (*Queries) UpsertRunTimer ¶
func (q *Queries) UpsertRunTimer(ctx context.Context, arg UpsertRunTimerParams) error
UpsertRunTimer sets the timer of a run at its deadline, a new lease to claim. The subject is the run: the Alert Group and the Storm are null, and the conflict is on timers_escalation_run_key, never timers_alert_group_key.
type ResolveDestinationsRow ¶
type ResolveSchedulesParams ¶
type ResolveSchedulesRow ¶
type ResolveTeamsParams ¶
type ResolveTeamsRow ¶
type ResolveUsersParams ¶
type ResolveUsersRow ¶
type SaveRunParams ¶
type SetRunSourcesParams ¶
type ShareChainsParams ¶
type ShareChainsParams struct {
}
type ShareChainsRow ¶
type ShareChainsRow struct {
}
type SnapshotStepsParams ¶
type SnapshotStepsRow ¶
type SnapshotStepsRow struct {
ChainID int64
Position int32
Kind string
Importance pgtype.Text
ScheduleID pgtype.Int8
SchedulePublicID pgtype.Text
TeamID pgtype.Int8
Everyone pgtype.Text
CallTarget pgtype.Text
GatewayConnectionID pgtype.Int8
WaitSeconds pgtype.Int4
DestinationID pgtype.Int8
RepeatFrom pgtype.Int4
RepeatTimes pgtype.Int4
WorkingHoursOnly bool
SeverityCondition string
UserIds []int64
}