Documentation
¶
Index ¶
- type DBTX
- type DeleteRuleTimersParams
- type DeleteRulesParams
- type GetOrganizationRulesRow
- type GetRuleRunGroupParams
- type GetRulesParams
- type GetRulesRow
- type GetRulesUserByIDParams
- type GetRulesUserByIDRow
- type GetRulesUserParams
- type GetRulesUserRow
- type InsertRuleRunParams
- type ListRuleGatewaysParams
- type ListRuleGatewaysRow
- type LockRuleRunParams
- type LockRuleRunRow
- type LockRulesUserParams
- type LockRulesUserRow
- type Queries
- func (q *Queries) DeleteRuleTimers(ctx context.Context, arg DeleteRuleTimersParams) error
- func (q *Queries) DeleteRules(ctx context.Context, arg DeleteRulesParams) (int64, error)
- func (q *Queries) GetOrganizationRules(ctx context.Context, orgID int64) (GetOrganizationRulesRow, error)
- func (q *Queries) GetRuleRunGroup(ctx context.Context, arg GetRuleRunGroupParams) (int64, error)
- func (q *Queries) GetRules(ctx context.Context, arg GetRulesParams) (GetRulesRow, error)
- func (q *Queries) GetRulesUser(ctx context.Context, arg GetRulesUserParams) (GetRulesUserRow, error)
- func (q *Queries) GetRulesUserByID(ctx context.Context, arg GetRulesUserByIDParams) (GetRulesUserByIDRow, error)
- func (q *Queries) InsertRuleRun(ctx context.Context, arg InsertRuleRunParams) (int64, error)
- func (q *Queries) ListRuleGateways(ctx context.Context, arg ListRuleGatewaysParams) ([]ListRuleGatewaysRow, error)
- func (q *Queries) LockRuleRun(ctx context.Context, arg LockRuleRunParams) (LockRuleRunRow, error)
- func (q *Queries) LockRulesUser(ctx context.Context, arg LockRulesUserParams) (LockRulesUserRow, error)
- func (q *Queries) NotifyRuleTimers(ctx context.Context, channel string) error
- func (q *Queries) SaveRuleRun(ctx context.Context, arg SaveRuleRunParams) error
- func (q *Queries) StopRuleRuns(ctx context.Context, arg StopRuleRunsParams) ([]int64, error)
- func (q *Queries) UpsertRuleTimer(ctx context.Context, arg UpsertRuleTimerParams) error
- func (q *Queries) UpsertRules(ctx context.Context, arg UpsertRulesParams) (int64, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SaveRuleRunParams
- type StopRuleRunsParams
- type UpsertRuleTimerParams
- type UpsertRulesParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteRuleTimersParams ¶
type DeleteRulesParams ¶
type GetOrganizationRulesRow ¶
type GetRuleRunGroupParams ¶
type GetRulesParams ¶
type GetRulesRow ¶
type GetRulesUserByIDParams ¶
type GetRulesUserByIDRow ¶
type GetRulesUserParams ¶
type GetRulesUserRow ¶
type InsertRuleRunParams ¶
type ListRuleGatewaysParams ¶
type ListRuleGatewaysRow ¶
type LockRuleRunParams ¶
type LockRuleRunRow ¶
type LockRuleRunRow struct {
ID int64
AlertGroupID int64
EscalationRunID int64
StepNumber int32
UserID int64
Importance string
Actions []byte
Position int32
State string
RunState string
ChainID int64
ChainName string
Sources []byte
OwningTeamID int64
ChainPublicID string
ScheduleID int64
Deadline time.Time
}
type LockRulesUserParams ¶
type LockRulesUserRow ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) DeleteRuleTimers ¶
func (q *Queries) DeleteRuleTimers(ctx context.Context, arg DeleteRuleTimersParams) error
DeleteRuleTimers deletes the timers of the rule runs.
func (*Queries) DeleteRules ¶
DeleteRules deletes the rules of a User, who then follows the Organization's rules; and those of a deleted User.
func (*Queries) GetOrganizationRules ¶
func (q *Queries) GetOrganizationRules(ctx context.Context, orgID int64) (GetOrganizationRulesRow, error)
GetOrganizationRules reads the Organization's default rules (organization.notification_rules) with the version of the organization resource, from which the ETag of the state organization comes.
func (*Queries) GetRuleRunGroup ¶
GetRuleRunGroup reads the Alert Group of a rule run, which the action of its timer locks first.
func (*Queries) GetRules ¶
func (q *Queries) GetRules(ctx context.Context, arg GetRulesParams) (GetRulesRow, error)
GetRules reads the rules of a User in the state call, no_call or custom; no row is the state organization.
func (*Queries) GetRulesUser ¶
func (q *Queries) GetRulesUser(ctx context.Context, arg GetRulesUserParams) (GetRulesUserRow, error)
GetRulesUser reads a User an Admin names, deleted ones included.
func (*Queries) GetRulesUserByID ¶
func (q *Queries) GetRulesUserByID(ctx context.Context, arg GetRulesUserByIDParams) (GetRulesUserByIDRow, error)
GetRulesUserByID reads the signed-in User.
func (*Queries) InsertRuleRun ¶
InsertRuleRun starts the run of a person's rule for a step that Paged them (C-31.FR-3), at its position and state after the actions it made at once, with the seq of the run step that started it, which its later Mentions belong to (C-32.FR-12).
func (*Queries) ListRuleGateways ¶
func (q *Queries) ListRuleGateways(ctx context.Context, arg ListRuleGatewaysParams) ([]ListRuleGatewaysRow, error)
ListRuleGateways lists every Bridge Connection, deleted ones included, which a call action may name: whether it is a Notification gateway now — not deleted, its info declaring the role gateway — and whether the User user_id has a confirmed contact there.
func (*Queries) LockRuleRun ¶
func (q *Queries) LockRuleRun(ctx context.Context, arg LockRuleRunParams) (LockRuleRunRow, error)
LockRuleRun locks a rule run for its next action, after its Alert Group, with the deadline of its timer — the zero time 0001-01-01 once it was removed — and the run of its chain: its state, its chain, its sources, the owning Team it had when it started and the Schedule of the step that Paged the person, 0 once that Schedule was deleted: the run's steps are a snapshot, which a deleted Schedule outlives.
func (*Queries) LockRulesUser ¶
func (q *Queries) LockRulesUser(ctx context.Context, arg LockRulesUserParams) (LockRulesUserRow, error)
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors Notification rules (C-31): the rules of the Users in the states call, no_call and custom, the Organization's default rules that the Users in the state organization follow, and the Notification gateways a call names. LockRulesUser locks the User whose rules change, so that the rules of one User change one at a time and never after the User's deletion, which locks the row first.
func (*Queries) NotifyRuleTimers ¶
NotifyRuleTimers wakes the timer workers of every replica once the transaction commits.
func (*Queries) SaveRuleRun ¶
func (q *Queries) SaveRuleRun(ctx context.Context, arg SaveRuleRunParams) error
SaveRuleRun writes where a rule run is after its actions.
func (*Queries) StopRuleRuns ¶
StopRuleRuns stops the rule runs that still run on an Alert Group whose chains stopped or started over (C-31.FR-3): those of runs that ran out included, whose rule may still repeat.
func (*Queries) UpsertRuleTimer ¶
func (q *Queries) UpsertRuleTimer(ctx context.Context, arg UpsertRuleTimerParams) error
UpsertRuleTimer sets the timer of a rule run at the end of its wait, a new lease to claim. The subject is the rule run: the Alert Group, the Storm and the run of the chain are null, and the conflict is on timers_notification_rule_run_key, never timers_alert_group_key (schema.md §4.10).
func (*Queries) UpsertRules ¶
UpsertRules writes the rules of a User with a new version from the sequence.