dbgen

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorStatisticsParams

type ActorStatisticsParams struct {
	OrgID               int64
	RangeFrom           time.Time
	RangeTo             time.Time
	RouteIds            []int64
	IntegrationIds      []int64
	Severities          []string
	Urgent              pgtype.Bool
	Reopened            pgtype.Bool
	TeamSet             bool
	TeamIds             []int64
	Contains            []byte
	FirstAcknowledgedBy pgtype.Int8
	IdsSet              bool
	Ids                 []int64
}

type ActorStatisticsRow

type ActorStatisticsRow struct {
	AcknowledgedByUserID   pgtype.Int8
	ResolvedByUserID       pgtype.Int8
	ServiceAccountID       pgtype.Int8
	AcknowledgedFirstCount int64
	ResolvedCount          int64
	AckMedian              float64
	AckP95                 float64
}

type AddAlertTeamsParams

type AddAlertTeamsParams struct {
	OrgID    int64
	AlertIds []int64
	TeamIds  []int64
	Rules    []string
	Matchers []string
}

type AddGroupTeamsParams

type AddGroupTeamsParams struct {
	OrgID        int64
	AlertGroupID int64
	JoinedAt     time.Time
	TeamIds      []int64
	Rules        []string
	Matchers     []string
}

type AddUnknownTeamValuesParams

type AddUnknownTeamValuesParams struct {
	OrgID      int64
	ID         int64
	TeamValues []string
}

type AdvanceOpenGroupUpdateParams

type AdvanceOpenGroupUpdateParams struct {
	AfterAlertGroupID int64
	LeaseUntil        time.Time
	OrgID             int64
	ID                int64
}

type ClaimOpenGroupUpdateParams

type ClaimOpenGroupUpdateParams struct {
	Owner      string
	LeaseUntil time.Time
	OrgID      int64
	Kinds      []string
	Now        time.Time
}

type ClaimOpenGroupUpdateRow

type ClaimOpenGroupUpdateRow struct {
	ID                     int64
	Kind                   string
	RouteID                pgtype.Int8
	RequestedAt            time.Time
	AfterAlertGroupID      int64
	RoutePublicID          string
	DestinationID          pgtype.Int8
	TeamID                 pgtype.Int8
	DestinationPublicID    string
	TeamPublicID           string
	UserID                 pgtype.Int8
	ServiceAccountID       pgtype.Int8
	UserPublicID           string
	ServiceAccountPublicID string
}

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
	Assignee        pgtype.Int8
	TeamSet         bool
	TeamIds         []int64
	SnoozedNoEnd    pgtype.Bool
	DeliveryProblem pgtype.Bool
	Unclaimed       pgtype.Bool
	Contains        []byte
	Pattern         pgtype.Text
}

type CountGroupsRow

type CountGroupsRow struct {
	Status       string
	CommonLabels []byte
	Count        int64
}

type CountOpenGroupsByIntegrationParams

type CountOpenGroupsByIntegrationParams struct {
	OrgID     int64
	PublicIds []string
}

type CountOpenGroupsByIntegrationRow

type CountOpenGroupsByIntegrationRow struct {
	PublicID string
	Count    int64
}

type CountOpenGroupsByRouteRow

type CountOpenGroupsByRouteRow struct {
	PublicID string
	Status   string
	Count    int64
}

type CountPageUsersParams

type CountPageUsersParams struct {
	OrgID  int64
	PageID int64
}

type CountPageUsersRow

type CountPageUsersRow struct {
	Total     int64
	Delivered int64
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteExpiredGroupsParams

type DeleteExpiredGroupsParams struct {
	OrgID     int64
	Cutoff    time.Time
	BatchSize int32
}

type DeleteExpiredMembershipsParams

type DeleteExpiredMembershipsParams struct {
	OrgID     int64
	Cutoff    time.Time
	BatchSize int32
}

type DeleteExpiredRunStepsParams

type DeleteExpiredRunStepsParams struct {
	OrgID     int64
	Cutoff    time.Time
	BatchSize int32
}

type DeleteGroupAssigneesParams

type DeleteGroupAssigneesParams struct {
	OrgID        int64
	AlertGroupID int64
}

type DeleteOpenGroupUpdateParams

type DeleteOpenGroupUpdateParams struct {
	OrgID int64
	ID    int64
}

type DeleteRunAssigneesExceptParams

type DeleteRunAssigneesExceptParams struct {
	OrgID           int64
	AlertGroupID    int64
	EscalationRunID int64
	Keep            []int64
}

type DeleteTimerParams

type DeleteTimerParams struct {
	OrgID        int64
	AlertGroupID int64
	Kind         string
}

type EndPageParams

type EndPageParams struct {
	State  string
	Reason pgtype.Text
	Now    time.Time
	OrgID  int64
	ID     int64
}

type FindOpenGroupParams

type FindOpenGroupParams struct {
	OrgID          int64
	RouteID        int64
	GroupKeySha256 []byte
}

type FindReopenableGroupParams

type FindReopenableGroupParams struct {
	OrgID          int64
	RouteID        int64
	GroupKeySha256 []byte
	Now            time.Time
}

type GetGroupIDParams

type GetGroupIDParams struct {
	OrgID    int64
	PublicID string
}

type GetGroupIDRow

type GetGroupIDRow struct {
	ID                        int64
	ResolvedAt                pgtype.Timestamptz
	RetentionAlertDetailsDays int64
}

type GetGroupKeyParams

type GetGroupKeyParams struct {
	OrgID    int64
	PublicID string
}

type GetGroupKeyRow

type GetGroupKeyRow struct {
	ID             int64
	RouteID        int64
	GroupKeySha256 []byte
}

type GetGroupParams

type GetGroupParams struct {
	OrgID    int64
	PublicID string
}

type GetGroupRefParams

type GetGroupRefParams struct {
	OrgID int64
	ID    int64
}

type GetGroupRefRow

type GetGroupRefRow struct {
	PublicID string
	Number   int64
}

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 GetGroupTimerParams struct {
	OrgID        int64
	AlertGroupID int64
	Kind         string
}

type GetLastReminderSeqParams

type GetLastReminderSeqParams struct {
	OrgID        int64
	AlertGroupID int64
}

type GetListSettingsRow

type GetListSettingsRow struct {
	RetentionAlertDetailsDays int64
	TimeZone                  string
	WorkdayStart              string
	WeekStart                 string
}

type GetRetentionPeriodsRow

type GetRetentionPeriodsRow struct {
	RetentionAlertDetailsDays        int64
	RetentionAlertGroupSummariesDays int64
}

type GetRouteDeliverToTeamsParams

type GetRouteDeliverToTeamsParams struct {
	OrgID int64
	ID    int64
}

type GetRoutePolicyParams

type GetRoutePolicyParams struct {
	OrgID int64
	ID    int64
}

type GetRoutePolicyRow

type GetRoutePolicyRow struct {
	ID                   int64
	PublicID             string
	IsDefault            bool
	MinimumSeverity      string
	GroupKey             []string
	ReopenWindowSeconds  int64
	GracePeriodSeconds   int64
	UrgentRiseRemovesAck bool
}

type GetSnapshotReceivedAtParams

type GetSnapshotReceivedAtParams struct {
	OrgID int64
	ID    int64
}

type GetTeamsStampRow

type GetTeamsStampRow struct {
	TeamLabel    string
	TeamsVersion int64
}

type GetTimerPolicyParams

type GetTimerPolicyParams struct {
	OrgID int64
	ID    int64
}

type GetTimerPolicyRow

type GetTimerPolicyRow struct {
	AckTimeoutEnabled              bool
	AckTimeoutFirstIntervalSeconds int64
	RemindersEnabled               bool
	RemindersFirstIntervalSeconds  int64
	RemindersCapSeconds            int64
	AutoUnacknowledge              bool
}

type GetUserTimeZoneParams

type GetUserTimeZoneParams struct {
	OrgID int64
	ID    int64
}

type InsertDowntimeEntriesParams

type InsertDowntimeEntriesParams struct {
	OrgID         int64
	PublicIds     []string
	AlertGroupIds []int64
	At            time.Time
	PeriodFrom    time.Time
	PeriodTo      time.Time
}

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
	Description        pgtype.Text
	CommonLabels       []byte
	CommonAnnotations  []byte
	IntegrationIds     []int64
	SeverityLevel      string
	Urgent             bool
	FiringAgainAfterID pgtype.Int8
	CreatedAt          time.Time
}

type InsertMembershipsParams

type InsertMembershipsParams struct {
	OrgID         int64
	AlertGroupIds []int64
	AlertIds      []int64
	Episodes      []int64
	JoinedAt      time.Time
	StartsAts     []time.Time
	Annotations   [][]byte
}

type InsertNoteParams

type InsertNoteParams struct {
	OrgID                 int64
	PublicID              string
	AlertGroupID          int64
	EventSeq              int64
	Body                  string
	ActorKind             string
	ActorUserID           pgtype.Int8
	ActorServiceAccountID pgtype.Int8
	ApiTokenID            pgtype.Int8
	TokenName             pgtype.Text
	Transport             string
	CreatedAt             time.Time
}

type InsertPageParams

type InsertPageParams struct {
	OrgID                 int64
	AlertGroupID          int64
	EscalationRunID       pgtype.Int8
	NotificationRuleRunID pgtype.Int8
	StepNumber            int32
	Kind                  string
	TeamID                pgtype.Int8
	Everyone              pgtype.Text
	Importance            pgtype.Text
	ScheduleID            pgtype.Int8
	ChainTeamID           pgtype.Int8
	AgainSeconds          pgtype.Int4
	Again                 bool
	State                 string
	Reason                pgtype.Text
	Now                   time.Time
	EndedAt               pgtype.Timestamptz
	RunStepSeq            pgtype.Int4
	GatewayConnectionID   pgtype.Int8
}

type InsertPageUserParams

type InsertPageUserParams struct {
	OrgID   int64
	PageID  int64
	UserID  int64
	Outcome string
	Reason  pgtype.Text
}

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
	TeamID                pgtype.Int8
	TeamRule              pgtype.Text
	TeamMatcher           pgtype.Text
	TeamValue             pgtype.Text
	DestinationID         pgtype.Int8
	PagedUserIds          []int64
	GatewayConnectionID   pgtype.Int8
	EscalationRunID       pgtype.Int8
	EscalationChainID     pgtype.Int8
	StepNumber            pgtype.Int4
	PageEveryone          pgtype.Text
	PageImportance        pgtype.Text
	Assignees             []byte
}

type IntegrationStatisticsParams

type IntegrationStatisticsParams struct {
	TimeZone            string
	OrgID               int64
	RangeFrom           time.Time
	RangeTo             time.Time
	RouteIds            []int64
	IntegrationIds      []int64
	Severities          []string
	Urgent              pgtype.Bool
	Reopened            pgtype.Bool
	TeamSet             bool
	TeamIds             []int64
	Contains            []byte
	FirstAcknowledgedBy pgtype.Int8
	IdsSet              bool
	Ids                 []int64
}

type IntegrationStatisticsRow

type IntegrationStatisticsRow struct {
	SubjectID       int64
	Day             pgtype.Date
	Total           bool
	AlertGroupCount int64
	ResolveCount    int64
	ResolveMedian   float64
	ResolveP95      float64
	AckCount        int64
	AckMedian       float64
	AckP95          float64
}

type IsActiveUserParams

type IsActiveUserParams struct {
	OrgID int64
	ID    int64
}

type ListAlertGroupKeysParams

type ListAlertGroupKeysParams struct {
	OrgID    int64
	AlertIds []int64
}

type ListAlertGroupKeysRow

type ListAlertGroupKeysRow struct {
	AlertID  int64
	GroupKey string
}

type ListAlertTeamsParams

type ListAlertTeamsParams struct {
	OrgID    int64
	AlertIds []int64
}

type ListAlertTeamsRow

type ListAlertTeamsRow struct {
	AlertID          int64
	UnknownTeamValue string
	TeamID           int64
	Rule             string
	Matcher          string
}

type ListCallPagesParams

type ListCallPagesParams struct {
	OrgID         int64
	GatewayCallID pgtype.Int8
}

type ListCallPagesRow

type ListCallPagesRow struct {
	ID           int64
	AlertGroupID int64
}

type ListChangedAlertsParams

type ListChangedAlertsParams struct {
	OrgID int64
	Ids   []int64
}

type ListChangedAlertsRow

type ListChangedAlertsRow struct {
	ID                   int64
	IntegrationID        int64
	Fingerprint          string
	Labels               []byte
	Annotations          []byte
	StaticLabelConflicts []string
	Status               string
	StartsAt             time.Time
	Episode              int64
	RouteID              pgtype.Int8
	SeverityLevel        pgtype.Text
	NoTeams              bool
}

type ListEvaluatedGroupsAfterParams

type ListEvaluatedGroupsAfterParams struct {
	OrgID   int64
	AfterID int64
	Lim     int32
}

type ListFiringLevelsParams

type ListFiringLevelsParams struct {
	OrgID         int64
	AlertGroupIds []int64
}

type ListFiringLevelsRow

type ListFiringLevelsRow struct {
	AlertGroupID  int64
	SeverityLevel string
}

type ListFiringMembershipsParams

type ListFiringMembershipsParams struct {
	OrgID    int64
	AlertIds []int64
}

type ListFiringMembershipsRow

type ListFiringMembershipsRow struct {
	ID           int64
	AlertGroupID int64
	AlertID      int64
	Episode      int64
	StartsAt     time.Time
	Annotations  []byte
}

type ListGroupAlertTeamsParams

type ListGroupAlertTeamsParams struct {
	OrgID    int64
	AlertIds []int64
}

type ListGroupAlertTeamsRow

type ListGroupAlertTeamsRow struct {
	AlertID  int64
	PublicID string
	Name     string
	Slug     string
	Deleted  bool
	Rule     string
	Matcher  pgtype.Text
}

type ListGroupAlertsParams

type ListGroupAlertsParams struct {
	OrgID        int64
	AlertGroupID int64
	AllStates    bool
	Firing       bool
	AfterRank    int32
	AfterID      int64
	Lim          int32
}

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 ListGroupAssigneesParams

type ListGroupAssigneesParams struct {
	OrgID         int64
	AlertGroupIds []int64
}

type ListGroupAssigneesRow

type ListGroupAssigneesRow struct {
	AlertGroupID    int64
	EscalationRunID int64
	UserID          int64
	TeamID          pgtype.Int8
	Since           time.Time
}

type ListGroupFiringAlertsParams

type ListGroupFiringAlertsParams struct {
	OrgID         int64
	AlertGroupIds []int64
}

type ListGroupFiringAlertsRow

type ListGroupFiringAlertsRow struct {
	ID                   int64
	AlertGroupID         int64
	AlertID              int64
	Episode              int64
	StartsAt             time.Time
	Annotations          []byte
	IntegrationID        int64
	Fingerprint          string
	Labels               []byte
	StaticLabelConflicts []string
	SeverityLevel        pgtype.Text
	Status               string
}

type ListGroupTeamIDsParams

type ListGroupTeamIDsParams struct {
	OrgID        int64
	AlertGroupID int64
}

type ListGroupTeamsParams

type ListGroupTeamsParams struct {
	OrgID         int64
	AlertGroupIds []int64
}

type ListGroupTeamsRow

type ListGroupTeamsRow struct {
	AlertGroupID int64
	PublicID     string
	Name         string
	Slug         string
	Deleted      bool
	Rule         string
	Matcher      pgtype.Text
	JoinedAt     time.Time
}

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
	Assignee        pgtype.Int8
	TeamSet         bool
	TeamIds         []int64
	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
	Assignee        pgtype.Int8
	TeamSet         bool
	TeamIds         []int64
	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
	Assignee        pgtype.Int8
	TeamSet         bool
	TeamIds         []int64
	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
	Assignee        pgtype.Int8
	TeamSet         bool
	TeamIds         []int64
	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 ListGroupsTeamIDsParams

type ListGroupsTeamIDsParams struct {
	OrgID         int64
	AlertGroupIds []int64
}

type ListGroupsTeamIDsRow

type ListGroupsTeamIDsRow struct {
	AlertGroupID int64
	TeamID       int64
}

type ListIntegrationRefsParams

type ListIntegrationRefsParams struct {
	OrgID int64
	Ids   []int64
}

type ListIntegrationRefsRow

type ListIntegrationRefsRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListIntegrationsByPublicIDParams

type ListIntegrationsByPublicIDParams struct {
	OrgID     int64
	PublicIds []string
}

type ListIntegrationsByPublicIDRow

type ListIntegrationsByPublicIDRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListJoinedDuringSnoozeParams

type ListJoinedDuringSnoozeParams struct {
	OrgID        int64
	AlertGroupID int64
}

type ListOpenGroupsAfterParams

type ListOpenGroupsAfterParams struct {
	OrgID   int64
	AfterID int64
	Lim     int32
}

type ListOpenGroupsFollowingOrganizationAfterParams

type ListOpenGroupsFollowingOrganizationAfterParams struct {
	OrgID   int64
	AfterID int64
	Lim     int32
}

type ListOpenGroupsOfDestinationAfterParams

type ListOpenGroupsOfDestinationAfterParams struct {
	OrgID         int64
	AfterID       int64
	DestinationID int64
	Lim           int32
}

type ListOpenGroupsOfRouteAfterParams

type ListOpenGroupsOfRouteAfterParams struct {
	OrgID   int64
	RouteID int64
	AfterID int64
	Lim     int32
}

type ListOpenGroupsOfRouteParams

type ListOpenGroupsOfRouteParams struct {
	OrgID   int64
	RouteID int64
}

type ListOpenGroupsOfServiceAccountAfterParams

type ListOpenGroupsOfServiceAccountAfterParams struct {
	OrgID            int64
	AfterID          int64
	ServiceAccountID pgtype.Int8
	Lim              int32
}

type ListOpenGroupsOfTeamAfterParams

type ListOpenGroupsOfTeamAfterParams struct {
	OrgID   int64
	AfterID int64
	TeamID  int64
	Lim     int32
}

type ListOpenGroupsOfUserAfterParams

type ListOpenGroupsOfUserAfterParams struct {
	OrgID   int64
	AfterID int64
	UserID  pgtype.Int8
	Lim     int32
}

type ListOwnedGroupsParams

type ListOwnedGroupsParams struct {
	OrgID  int64
	UserID int64
}

type ListReachEntriesParams

type ListReachEntriesParams struct {
	OrgID        int64
	AlertGroupID int64
	RouteID      int64
}

type ListReachEntriesRow

type ListReachEntriesRow struct {
	Kind              string
	TeamID            int64
	DestinationID     int64
	SeverityCondition string
	PublicID          string
	Name              string
	Type              string
	Delivered         bool
}

type ListRelatedGroupsParams

type ListRelatedGroupsParams struct {
	OrgID          int64
	RouteID        int64
	GroupKeySha256 []byte
	ID             int64
	AfterAt        pgtype.Timestamptz
	AfterID        pgtype.Int8
	Lim            int32
}

type ListRelatedGroupsRow

type ListRelatedGroupsRow struct {
	ID                         int64
	PublicID                   string
	Number                     int64
	Status                     string
	CreatedAt                  time.Time
	ResolvedAt                 pgtype.Timestamptz
	ResolvedByKind             pgtype.Text
	ResolvedByUserID           pgtype.Int8
	ResolvedByServiceAccountID pgtype.Int8
	ResolveReason              pgtype.Text
	ResolveReasonText          pgtype.Text
}

type ListRoutesByPublicIDParams

type ListRoutesByPublicIDParams struct {
	OrgID     int64
	PublicIds []string
}

type ListRoutesByPublicIDRow

type ListRoutesByPublicIDRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListRunAssigneesParams

type ListRunAssigneesParams struct {
	OrgID           int64
	AlertGroupID    int64
	EscalationRunID int64
}

type ListRunAssigneesRow

type ListRunAssigneesRow struct {
	UserID     int64
	RunStepSeq pgtype.Int4
}

type ListServiceAccountRefsParams

type ListServiceAccountRefsParams struct {
	OrgID int64
	Ids   []int64
}

type ListServiceAccountRefsRow

type ListServiceAccountRefsRow struct {
	ID       int64
	PublicID string
	Name     string
	Status   string
}

type ListStatisticsGroupLabelsParams

type ListStatisticsGroupLabelsParams struct {
	OrgID               int64
	RangeFrom           time.Time
	RangeTo             time.Time
	RouteIds            []int64
	IntegrationIds      []int64
	Severities          []string
	Urgent              pgtype.Bool
	Reopened            pgtype.Bool
	TeamSet             bool
	TeamIds             []int64
	Contains            []byte
	FirstAcknowledgedBy pgtype.Int8
}

type ListStatisticsGroupLabelsRow

type ListStatisticsGroupLabelsRow struct {
	CommonLabels []byte
	Ids          []int64
}

type ListStatisticsIntegrationsParams

type ListStatisticsIntegrationsParams struct {
	OrgID   int64
	OnlyIds []int64
	WithIds []int64
}

type ListStatisticsIntegrationsRow

type ListStatisticsIntegrationsRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListStatisticsRoutesParams

type ListStatisticsRoutesParams struct {
	OrgID   int64
	OnlyIds []int64
	WithIds []int64
}

type ListStatisticsRoutesRow

type ListStatisticsRoutesRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListStatisticsTeamsParams

type ListStatisticsTeamsParams struct {
	OrgID   int64
	OnlyIds []int64
	WithIds []int64
}

type ListStatisticsTeamsRow

type ListStatisticsTeamsRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListTeamRefsParams

type ListTeamRefsParams struct {
	OrgID int64
	Ids   []int64
}

type ListTeamRefsRow

type ListTeamRefsRow struct {
	ID       int64
	PublicID string
	Name     string
	Slug     string
	Deleted  bool
}

type ListTeamsByPublicIDParams

type ListTeamsByPublicIDParams struct {
	OrgID     int64
	PublicIds []string
}

type ListTeamsByPublicIDRow

type ListTeamsByPublicIDRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListTimelineAscParams

type ListTimelineAscParams struct {
	OrgID        int64
	AlertGroupID int64
	Kinds        []string
	At           pgtype.Timestamptz
	Source       int32
	ID           int64
	Lim          int32
}

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
	TeamID                pgtype.Int8
	TeamRule              pgtype.Text
	TeamMatcher           pgtype.Text
	TeamValue             pgtype.Text
	DestinationID         pgtype.Int8
	PagedUserIds          []int64
	GatewayConnectionID   pgtype.Int8
	EscalationRunID       pgtype.Int8
	EscalationChainID     pgtype.Int8
	StepNumber            pgtype.Int4
	Assignees             []byte
	PageEveryone          pgtype.Text
	PageImportance        pgtype.Text
}

type ListTimelineChainsParams

type ListTimelineChainsParams struct {
	OrgID int64
	Ids   []int64
}

type ListTimelineChainsRow

type ListTimelineChainsRow struct {
	RunID         int64
	ChainName     string
	ChainPublicID pgtype.Text
	ChainNameNow  pgtype.Text
	TeamPublicID  pgtype.Text
	TeamName      pgtype.Text
	TeamSlug      pgtype.Text
	TeamDeleted   bool
}

type ListTimelineDeliveryEventsParams

type ListTimelineDeliveryEventsParams struct {
	OrgID        int64
	AlertGroupID int64
	At           pgtype.Timestamptz
	Descending   bool
	Source       int32
	ID           int64
	Lim          int32
}

type ListTimelineDeliveryEventsRow

type ListTimelineDeliveryEventsRow struct {
	ID                  int64
	PublicID            string
	OccurredAt          time.Time
	Kind                string
	Loudness            string
	Mentions            []string
	Error               pgtype.Text
	DestinationPublicID string
	DestinationName     string
	Detail              []byte
	MentionTeamPublicID string
	MentionTeamName     string
	MentionTeamSlug     string
	MentionTeamDeleted  bool
}

type ListTimelineDescParams

type ListTimelineDescParams struct {
	OrgID        int64
	AlertGroupID int64
	Kinds        []string
	At           pgtype.Timestamptz
	Source       int32
	ID           int64
	Lim          int32
}

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
	TeamID                pgtype.Int8
	TeamRule              pgtype.Text
	TeamMatcher           pgtype.Text
	TeamValue             pgtype.Text
	DestinationID         pgtype.Int8
	PagedUserIds          []int64
	GatewayConnectionID   pgtype.Int8
	EscalationRunID       pgtype.Int8
	EscalationChainID     pgtype.Int8
	StepNumber            pgtype.Int4
	Assignees             []byte
	PageEveryone          pgtype.Text
	PageImportance        pgtype.Text
}

type ListTimelineDestinationsParams

type ListTimelineDestinationsParams struct {
	OrgID int64
	Ids   []int64
}

type ListTimelineDestinationsRow

type ListTimelineDestinationsRow struct {
	ID           int64
	PublicID     string
	Name         string
	Type         string
	Health       string
	BrokenSince  pgtype.Timestamptz
	BrokenReason pgtype.Text
}

type ListTimelineGatewaysParams

type ListTimelineGatewaysParams struct {
	OrgID int64
	Ids   []int64
}

type ListTimelineGatewaysRow

type ListTimelineGatewaysRow struct {
	ID       int64
	PublicID string
	Name     string
}

type ListTimelineNotesParams

type ListTimelineNotesParams struct {
	OrgID        int64
	AlertGroupID int64
	At           pgtype.Timestamptz
	Descending   bool
	Source       int32
	ID           int64
	Lim          int32
}

type ListTimelineNotesRow

type ListTimelineNotesRow struct {
	ID                    int64
	PublicID              string
	CreatedAt             time.Time
	Body                  string
	ActorKind             string
	ActorUserID           pgtype.Int8
	ActorServiceAccountID pgtype.Int8
	TokenName             pgtype.Text
	Transport             string
}

type ListUserRefsParams

type ListUserRefsParams struct {
	OrgID int64
	Ids   []int64
}

type ListUserRefsRow

type ListUserRefsRow struct {
	ID       int64
	PublicID string
	Name     string
	Login    string
	Status   string
}

type ListUserTeamIDsParams

type ListUserTeamIDsParams struct {
	OrgID  int64
	UserID int64
}

type ListUsersByPublicIDParams

type ListUsersByPublicIDParams struct {
	OrgID     int64
	PublicIds []string
}

type ListUsersByPublicIDRow

type ListUsersByPublicIDRow struct {
	ID       int64
	PublicID string
	Name     string
}

type LockActiveUserParams

type LockActiveUserParams struct {
	OrgID int64
	ID    int64
}

type LockDefaultRouteRow

type LockDefaultRouteRow struct {
	ID                   int64
	PublicID             string
	IsDefault            bool
	MinimumSeverity      string
	GroupKey             []string
	ReopenWindowSeconds  int64
	GracePeriodSeconds   int64
	UrgentRiseRemovesAck bool
}

type LockGroupsParams

type LockGroupsParams struct {
	OrgID int64
	Ids   []int64
}

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
	Description                    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
	FirstAcknowledgedByUserID      pgtype.Int8
	ChainGeneration                int64
}

type LockOpenGroupUpdateParams

type LockOpenGroupUpdateParams struct {
	OrgID int64
	ID    int64
	Owner string
	Now   time.Time
}

type LockOpenGroupUpdateRow

type LockOpenGroupUpdateRow struct {
	ID                int64
	Kind              string
	RouteID           pgtype.Int8
	DestinationID     pgtype.Int8
	TeamID            pgtype.Int8
	UserID            pgtype.Int8
	ServiceAccountID  pgtype.Int8
	AfterAlertGroupID int64
}

type LockPageParams

type LockPageParams struct {
	OrgID        int64
	ID           int64
	AlertGroupID int64
}

type LockPageRow

type LockPageRow struct {
	ID              int64
	AlertGroupID    int64
	Kind            string
	State           string
	StepNumber      int32
	Team            bool
	Importance      string
	EscalationRunID pgtype.Int8
	ChainID         pgtype.Int8
	ChainPublicID   string
	ChainName       string
	RunState        string
	OwningTeamID    pgtype.Int8
	RunStepSeq      pgtype.Int4
	RuleRunState    string
	RunEndedAt      pgtype.Timestamptz
	RuleRunEndedAt  pgtype.Timestamptz
	RunSupersededAt time.Time
}

type LockRouteForMoveParams

type LockRouteForMoveParams struct {
	OrgID    int64
	PublicID string
}

type LockRouteForMoveRow

type LockRouteForMoveRow struct {
	ID        int64
	PublicID  string
	Name      string
	IsDefault bool
}

type LockRouteStormParams

type LockRouteStormParams struct {
	OrgID   int64
	RouteID int64
}

type LockRoutesParams

type LockRoutesParams struct {
	OrgID int64
	Ids   []int64
}

type LockRoutesRow

type LockRoutesRow struct {
	ID                   int64
	PublicID             string
	IsDefault            bool
	MinimumSeverity      string
	GroupKey             []string
	ReopenWindowSeconds  int64
	GracePeriodSeconds   int64
	UrgentRiseRemovesAck bool
}

type LockTeamEvaluationParams

type LockTeamEvaluationParams struct {
	LockClass int32
	OrgID     int64
}

type MissCallPageUsersParams

type MissCallPageUsersParams struct {
	Reason pgtype.Text
	OrgID  int64
	PageID int64
}

type MissPageUsersParams

type MissPageUsersParams struct {
	OrgID  int64
	PageID int64
}

type MoveMembershipsParams

type MoveMembershipsParams struct {
	EndedAt  time.Time
	OrgID    int64
	Ids      []int64
	MovedTos []int64
}

type NextOpenGroupUpdateParams

type NextOpenGroupUpdateParams struct {
	Now   time.Time
	OrgID int64
	Kinds []string
}

type PeekGroupParams

type PeekGroupParams struct {
	OrgID int64
	ID    int64
}

type PeekGroupRow

type PeekGroupRow struct {
	RouteID       int64
	GraceDeadline pgtype.Timestamptz
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) ActorStatistics

func (q *Queries) ActorStatistics(ctx context.Context, arg ActorStatisticsParams) ([]ActorStatisticsRow, error)

ActorStatistics aggregates the Alert Groups twice and joins both by actor (C-09.FR-28): per User of their first acknowledgement, with its count, median and 95th percentile of time to acknowledge in seconds (0 without any), the Alert Groups acknowledged with no User making one row with acknowledged_by_user_id null; and per resolver of a Resolve by a User or a Service account. A User who did both is one row; a Service account only resolves.

func (*Queries) AddAlertTeams

func (q *Queries) AddAlertTeams(ctx context.Context, arg AddAlertTeamsParams) error

AddAlertTeams adds Teams to the Teams of firing Alerts, with the rule that decided each and the Team matcher of the rule matcher, an empty matcher being null: the evaluation on save only adds, so a Team an Alert already has keeps its rule. The rows go in the order (Alert, Team); the lock of the evaluation (LockTeamEvaluation) keeps Snapshots and other batches from writing the same rows meanwhile.

func (*Queries) AddGroupTeams

func (q *Queries) AddGroupTeams(ctx context.Context, arg AddGroupTeamsParams) ([]int64, error)

AddGroupTeams adds Teams to the Teams of an Alert Group, which only grow, and returns those it added: a Team the Alert Group already has keeps its rule and when it joined.

func (*Queries) AddUnknownTeamValues

func (q *Queries) AddUnknownTeamValues(ctx context.Context, arg AddUnknownTeamValuesParams) ([]string, error)

AddUnknownTeamValues adds values of the Team label that name no Team to those an Alert Group recorded, and returns the values it added, sorted: each is recorded once per Alert Group.

func (*Queries) AdvanceOpenGroupUpdate

func (q *Queries) AdvanceOpenGroupUpdate(ctx context.Context, arg AdvanceOpenGroupUpdateParams) error

AdvanceOpenGroupUpdate records the last Alert Group a batch reached and renews the lease.

func (*Queries) ClaimOpenGroupUpdate

func (q *Queries) ClaimOpenGroupUpdate(ctx context.Context, arg ClaimOpenGroupUpdateParams) ([]ClaimOpenGroupUpdateRow, error)

The queue of the changes of configuration that reach the open Alert Groups after the save (open_group_updates, schema.md §5): a row is claimed by one worker with a lease on the real clock, walks the open Alert Groups of its scope by id in batches, and is deleted with its last batch. ClaimOpenGroupUpdate leases the earliest row of the kinds this replica handles whose lease is free or ran out, with the public_id of its Route, its Destination, its Team, its User or its Service account, if any, for its log lines; another claimer skips the row this one locked. A row of a kind that a later version adds waits for a replica that handles it.

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) CountPageUsers

func (q *Queries) CountPageUsers(ctx context.Context, arg CountPageUsersParams) (CountPageUsersRow, error)

CountPageUsers counts the people of a Page and those it reached.

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) DeleteExpiredRunSteps

func (q *Queries) DeleteExpiredRunSteps(ctx context.Context, arg DeleteExpiredRunStepsParams) (int64, error)

DeleteExpiredRunSteps deletes at most @batch_size steps of the runs of Escalation chains on Alert Groups resolved before @cutoff, the details of those Alert Groups ("How it went"); the runs stay with their summary rows. It starts from the steps still present that were made before the cutoff (escalation_run_steps_at_idx) — a step is made while its Alert Group fires, so before it resolves — and not from every Alert Group resolved long ago, whose steps are mostly gone. Rows another transaction holds wait for the next run.

func (*Queries) DeleteGroupAssignees

func (q *Queries) DeleteGroupAssignees(ctx context.Context, arg DeleteGroupAssigneesParams) (int64, error)

DeleteGroupAssignees removes every Assignee of an Alert Group: Acknowledge, Snooze and Resolve clear them.

func (*Queries) DeleteOpenGroupUpdate

func (q *Queries) DeleteOpenGroupUpdate(ctx context.Context, arg DeleteOpenGroupUpdateParams) error

DeleteOpenGroupUpdate removes a row with its last batch: the table holds only work still to do.

func (*Queries) DeleteRunAssigneesExcept

func (q *Queries) DeleteRunAssigneesExcept(ctx context.Context, arg DeleteRunAssigneesExceptParams) (int64, error)

DeleteRunAssigneesExcept removes the Assignees of a run other than @keep, whom a later step replaces.

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) EndPage

func (q *Queries) EndPage(ctx context.Context, arg EndPageParams) error

EndPage ends a Page with its outcome.

func (*Queries) EnsureCounter

func (q *Queries) EnsureCounter(ctx context.Context, orgID int64) error

EnsureCounter creates the Organization's row of alert_group_counters on first use.

func (*Queries) FindOpenGroup

func (q *Queries) FindOpenGroup(ctx context.Context, arg FindOpenGroupParams) (int64, error)

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) 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 Severity level alone, Urgent exactly when critical (C-26.FR-8), whatever routes.urgent and organizations.critical_is_urgent hold, which a 0.1 replica of a rolling update may still write. 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

func (q *Queries) GetGroupTimer(ctx context.Context, arg GetGroupTimerParams) (time.Time, error)

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) ([]string, 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, alert_group_teams, timeline_entries, notes and alert_group_counters (lint 2). Times are business times passed in from Go. GetGroupingSettings reads the Organization settings grouping needs: 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

func (q *Queries) GetListSettings(ctx context.Context, orgID int64) (GetListSettingsRow, error)

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) GetRouteDeliverToTeams

func (q *Queries) GetRouteDeliverToTeams(ctx context.Context, arg GetRouteDeliverToTeamsParams) (bool, error)

GetRouteDeliverToTeams reads "Also to the Teams from the label" of a Route, deleted or not.

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) GetTeamsStamp

func (q *Queries) GetTeamsStamp(ctx context.Context, orgID int64) (GetTeamsStampRow, error)

GetTeamsStamp reads the stamp of the classification by Teams: the Team label and organizations.teams_version, which every change of a Team or of the Team label raises.

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

func (q *Queries) GetUserTimeZone(ctx context.Context, arg GetUserTimeZoneParams) (string, error)

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

func (q *Queries) InsertGroup(ctx context.Context, arg InsertGroupParams) (int64, error)

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) InsertPage

func (q *Queries) InsertPage(ctx context.Context, arg InsertPageParams) (int64, error)

InsertPage writes a Page of a step or of an action of a Notification rule (C-32.FR-9, schema.md §4.18): by Mention, pending until its Thread replies end, or ended at once, as not_delivered for no_root_message; or a call through the Notification gateway gateway_connection_id, pending until its call ends. The first Mentions of a step and the calls of a call step carry the seq of its run step.

func (*Queries) InsertPageUser

func (q *Queries) InsertPageUser(ctx context.Context, arg InsertPageUserParams) error

InsertPageUser writes a person a Page names with their outcome and its reason.

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

func (q *Queries) IsActiveUser(ctx context.Context, arg IsActiveUserParams) (bool, error)

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) ListAlertTeams

func (q *Queries) ListAlertTeams(ctx context.Context, arg ListAlertTeamsParams) ([]ListAlertTeamsRow, error)

ListAlertTeams reads, for Alerts that join an Alert Group, the Teams routing gave each when it started firing — those that are not deleted, with the rule and the Team matcher — and the value of its Team label that named no Team, empty once it is the slug of a Team that is not deleted, with a row of team_id 0 for an Alert without a Team.

func (*Queries) ListCallPages

func (q *Queries) ListCallPages(ctx context.Context, arg ListCallPagesParams) ([]ListCallPagesRow, error)

ListCallPages lists the pending Pages that joined the call gateway_call_id, with their Alert Groups, in id order.

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, and whether routing recorded no Team and no value of the Team label that names no Team on each (no_teams).

func (*Queries) ListEvaluatedGroupsAfter

func (q *Queries) ListEvaluatedGroupsAfter(ctx context.Context, arg ListEvaluatedGroupsAfterParams) ([]int64, error)

ListEvaluatedGroupsAfter lists, by id after a cursor, a batch of the Alert Groups whose firing Alerts the evaluation on a save of a Team or of the Team label classifies again (C-25.FR-13): the open ones, and those a person resolved that are still in their Grace period, whose firing tails the end of the Grace period groups again; and those with a pending delivery, whose final edit a change of the Organization's message settings re-renders (the evaluation leaves a resolved Alert Group outside its Grace period as it is). The first branch reads alert_groups_evaluated_idx, not the primary key from the cursor: its condition implies the index predicate with constants only, no parameters, so generic plans use it too.

func (*Queries) ListFiringLevels

func (q *Queries) ListFiringLevels(ctx context.Context, arg ListFiringLevelsParams) ([]ListFiringLevelsRow, error)

ListFiringLevels reads the highest Severity level of the firing Alerts of each of the Alert Groups that has any; an Alert without a level counts as info.

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) ListGroupAlertTeams

func (q *Queries) ListGroupAlertTeams(ctx context.Context, arg ListGroupAlertTeamsParams) ([]ListGroupAlertTeamsRow, error)

ListGroupAlertTeams lists the Teams of Alerts as routing decided them, deleted ones included with their name.

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) ListGroupAssignees

func (q *Queries) ListGroupAssignees(ctx context.Context, arg ListGroupAssigneesParams) ([]ListGroupAssigneesRow, error)

ListGroupAssignees lists the Assignees of the firing ones of Alert Groups by internal ids, by chain in the order the runs started, then in the order they became Assignees: only a firing Alert Group has Assignees, and the rows a replica without migration 0050 left after an acknowledgement never show.

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) ListGroupTeamIDs

func (q *Queries) ListGroupTeamIDs(ctx context.Context, arg ListGroupTeamIDsParams) ([]int64, error)

ListGroupTeamIDs lists the Teams of an Alert Group by id, deleted ones included.

func (*Queries) ListGroupTeams

func (q *Queries) ListGroupTeams(ctx context.Context, arg ListGroupTeamsParams) ([]ListGroupTeamsRow, error)

ListGroupTeams lists the Teams of Alert Groups, deleted ones included with their name, each Alert Group's in the order they joined.

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; @assignee the firing ones where that User is an Assignee (C-32.FR-18), through alert_group_assignees_user_idx — only a firing Alert Group has Assignees, and the rows a replica without migration 0050 left after an acknowledgement never show. 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) ListGroupsTeamIDs

func (q *Queries) ListGroupsTeamIDs(ctx context.Context, arg ListGroupsTeamIDsParams) ([]ListGroupsTeamIDsRow, error)

ListGroupsTeamIDs lists the Teams of the Alert Groups, deleted ones included, by Alert Group and Team.

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

func (q *Queries) ListOpenGroupIDs(ctx context.Context, orgID int64) ([]int64, error)

ListOpenGroupIDs lists the open Alert Groups of the Organization, for the downtime entries.

func (*Queries) ListOpenGroupsAfter

func (q *Queries) ListOpenGroupsAfter(ctx context.Context, arg ListOpenGroupsAfterParams) ([]int64, error)

ListOpenGroupsAfter lists, by id after a cursor, a batch of the open Alert Groups of the Organization, and of the resolved ones with a pending delivery, whose links a change of a Link rule or of a Lookup table re-renders.

func (*Queries) ListOpenGroupsFollowingOrganizationAfter

func (q *Queries) ListOpenGroupsFollowingOrganizationAfter(ctx context.Context, arg ListOpenGroupsFollowingOrganizationAfterParams) ([]int64, error)

ListOpenGroupsFollowingOrganizationAfter lists, by id after a cursor, a batch of the open Alert Groups with a delivery that is not being retired in a messenger Destination that is not deleted and follows the Organization's button set, and of the resolved ones whose delivery in such a Destination is pending, whose Root messages a change of that set re-renders (C-28.FR-9).

func (*Queries) ListOpenGroupsOfDestinationAfter

func (q *Queries) ListOpenGroupsOfDestinationAfter(ctx context.Context, arg ListOpenGroupsOfDestinationAfterParams) ([]int64, error)

The walks of a change of configuration below take, besides the open Alert Groups, the resolved ones whose final edit still waits — those with a pending delivery — so that the final edit shows the change: delivery renders such an Alert Group again only in the Destinations where its delivery is still pending, so a final edit that went out, or a delivery that ended, is never sent again. Each walk is a UNION of two branches, each ordered by id and limited to the batch: the open Alert Groups, read as before, and the resolved ones, read from the pending deliveries after the cursor in the order of their Alert Group through deliveries_alert_group_pending_idx, once each; the batch is the first of both by id. That branch's conditions imply the index predicate whatever the parameters are — p.state = 'pending' is a constant, and p.alert_group_id > @after_id holds for no null Alert Group — so generic plans use the index too. It looks up the Alert Group of each pending delivery in a LATERAL subquery with LIMIT 1, which PostgreSQL keeps as a lookup by primary key per delivery: as a join, it merged the deliveries with alert_groups_pkey walked from the cursor, every resolved Alert Group up to the first pending one. ListOpenGroupsOfDestinationAfter lists, by id after a cursor, a batch of the open Alert Groups with a delivery in a Destination that is not being retired, and of the resolved ones whose delivery there is pending and not being retired, whose Root messages its button set (C-28.FR-9) and its Connection (C-12.FR-12) re-render.

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) ListOpenGroupsOfRouteAfter

func (q *Queries) ListOpenGroupsOfRouteAfter(ctx context.Context, arg ListOpenGroupsOfRouteAfterParams) ([]int64, error)

ListOpenGroupsOfRouteAfter lists, by id after a cursor, a batch of the open Alert Groups of a Route, those moved to it included, and of its resolved ones with a pending delivery, which a change of the Route's settings re-renders; its Minimum severity leaves the resolved ones as they are.

func (*Queries) ListOpenGroupsOfServiceAccountAfter

func (q *Queries) ListOpenGroupsOfServiceAccountAfter(ctx context.Context, arg ListOpenGroupsOfServiceAccountAfterParams) ([]int64, error)

ListOpenGroupsOfServiceAccountAfter lists, by id after a cursor, a batch of the Alert Groups whose footer names the Service account — who snoozed them, and who resolved them while their final edit still waits, with a pending delivery — which a rename of it re-renders.

func (*Queries) ListOpenGroupsOfTeamAfter

func (q *Queries) ListOpenGroupsOfTeamAfter(ctx context.Context, arg ListOpenGroupsOfTeamAfterParams) ([]int64, error)

ListOpenGroupsOfTeamAfter lists, by id after a cursor, a batch of the open Alert Groups that have the Team, and of the resolved ones with a pending delivery, whose Root messages show its name, which a rename re-renders; a change of the Team's Destination entries walks the same list and leaves the resolved ones out.

func (*Queries) ListOpenGroupsOfUserAfter

func (q *Queries) ListOpenGroupsOfUserAfter(ctx context.Context, arg ListOpenGroupsOfUserAfterParams) ([]int64, error)

ListOpenGroupsOfUserAfter lists, by id after a cursor, a batch of the Alert Groups whose footer names the User (C-12.FR-12) — their Owner while acknowledged, who snoozed them while snoozed, an Assignee of them while firing (C-32.FR-12), through alert_group_assignees_user_idx and once however many chains made them one, and who resolved them while their final edit still waits, with a pending delivery — which a change of the User's display name or Account links re-renders. An Assignee row left on an Alert Group that no longer fires names nobody, as in ListGroupAssignees.

func (*Queries) ListOwnedGroups

func (q *Queries) ListOwnedGroups(ctx context.Context, arg ListOwnedGroupsParams) ([]int64, error)

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) ListReachEntries

func (q *Queries) ListReachEntries(ctx context.Context, arg ListReachEntriesParams) ([]ListReachEntriesRow, error)

ListReachEntries lists the Destination entries the reach of an Alert Group is computed from: those of its Route and those of its Teams, each with its Severity condition, of the Destinations that are not deleted and have a Root message — an outgoing webhook in the events mode has none — with whether the Alert Group already has a Root message there: one whose final edit was made, or that was withheld, does not count, so the Destination joins it again with a new Publication; one whose final edit still waits counts, as its Root message stays, and the growth keeps it current instead of giving it the final edit (delivery's Enqueue) — by Destination.

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

func (q *Queries) ListRoutePublicIDs(ctx context.Context, orgID int64) ([]string, error)

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) ListRunAssignees

func (q *Queries) ListRunAssignees(ctx context.Context, arg ListRunAssigneesParams) ([]ListRunAssigneesRow, error)

The Assignees of Alert Groups (C-32.FR-12, schema.md §4.9): per run of a chain, the people its latest step Paging people by name reached; only the dispatcher writes them, and only while the Alert Group is firing. ListRunAssignees lists the Assignees of a run with the run step that made them.

func (*Queries) ListServiceAccountRefs

func (q *Queries) ListServiceAccountRefs(ctx context.Context, arg ListServiceAccountRefsParams) ([]ListServiceAccountRefsRow, error)

ListServiceAccountRefs names Service accounts, deleted ones included.

func (*Queries) ListStatisticsGroupLabels

func (q *Queries) ListStatisticsGroupLabels(ctx context.Context, arg ListStatisticsGroupLabelsParams) ([]ListStatisticsGroupLabelsRow, error)

ListStatisticsGroupLabels reads the common labels of the Alert Groups of the statistics' filters, with the ids of the Alert Groups that have them, for the Matchers that Go applies.

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) ListStatisticsTeams

func (q *Queries) ListStatisticsTeams(ctx context.Context, arg ListStatisticsTeamsParams) ([]ListStatisticsTeamsRow, error)

ListStatisticsTeams lists the subjects of the statistics per Team, as ListStatisticsRoutes does.

func (*Queries) ListTeamRefs

func (q *Queries) ListTeamRefs(ctx context.Context, arg ListTeamRefsParams) ([]ListTeamRefsRow, error)

ListTeamRefs names Teams, deleted ones included: the Teams of the Timeline entries.

func (*Queries) ListTeamsByPublicID

func (q *Queries) ListTeamsByPublicID(ctx context.Context, arg ListTeamsByPublicIDParams) ([]ListTeamsByPublicIDRow, error)

ListTeamsByPublicID names Teams, deleted ones included, by public_id: the filter by Team of the list.

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) ListTimelineChains

func (q *Queries) ListTimelineChains(ctx context.Context, arg ListTimelineChainsParams) ([]ListTimelineChainsRow, error)

ListTimelineChains names the chains of the escalation entries by their runs: the chain with its owning Team, null once deleted, and the name of the chain when the run started.

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: every kind but mention_delivered, which only closes the warnings of a Destination (C-28.FR-3), with the detail of a mention_not_delivered and the Team its entry's target names.

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) ListTimelineDestinations

func (q *Queries) ListTimelineDestinations(ctx context.Context, arg ListTimelineDestinationsParams) ([]ListTimelineDestinationsRow, error)

ListTimelineDestinations names the Destinations of destination_joined and escalation_webhook entries, deleted ones included, with their health.

func (*Queries) ListTimelineGateways

func (q *Queries) ListTimelineGateways(ctx context.Context, arg ListTimelineGatewaysParams) ([]ListTimelineGatewaysRow, error)

ListTimelineGateways names the Notification gateways of the escalation entries of calls, deleted ones included.

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) ListUserTeamIDs

func (q *Queries) ListUserTeamIDs(ctx context.Context, arg ListUserTeamIDsParams) ([]int64, error)

ListUserTeamIDs lists the Teams of a User, "My Teams" of the list.

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

func (q *Queries) LockActiveUser(ctx context.Context, arg LockActiveUserParams) ([]int64, error)

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

func (q *Queries) LockCounter(ctx context.Context, orgID int64) (int64, error)

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

func (q *Queries) LockDefaultRoute(ctx context.Context, orgID int64) (LockDefaultRouteRow, error)

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) LockOpenGroupUpdate

func (q *Queries) LockOpenGroupUpdate(ctx context.Context, arg LockOpenGroupUpdateParams) (LockOpenGroupUpdateRow, error)

LockOpenGroupUpdate locks a claimed row in the transaction of a batch while its lease is still this replica's at now, and reads where its run stands; no row when the lease was lost.

func (*Queries) LockPage

func (q *Queries) LockPage(ctx context.Context, arg LockPageParams) (LockPageRow, error)

LockPage locks a Page whose outcome its Thread replies settle, after its Alert Group, with the run, the chain and the step that made it, the importance of a Page of people, empty for none, the state and the owning Team of the run, which its Assignees take, and run_step_seq, the run step whose Page it is (C-32.FR-12): that of the rule run of a later Mention of a rule, which the step that started it made, else the Page's own; null for a Page or a rule run written before migration 0050. The state of the rule run, when the run and the rule run ended and when a later start of the chains superseded the run — the start of its first run — tell whether the chain or the rule of a call stopped before the call's first attempt; empty, null and 9999-12-31 for none.

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) LockRouteStorm

func (q *Queries) LockRouteStorm(ctx context.Context, arg LockRouteStormParams) ([]int64, error)

LockRouteStorm locks the active Storm of a Route that grouping creates an Alert Group in FOR NO KEY UPDATE, and ShareRouteStorm the active Storm of any other Route whose Alert Groups it changes FOR SHARE: both before the first change of an Alert Group, in Route id order, so that every grouping transaction takes its Storms in one order and none upgrades a Storm it shares (delivery's JoinStorm after its LockActiveStorm, the same predicate).

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) LockTeamEvaluation

func (q *Queries) LockTeamEvaluation(ctx context.Context, arg LockTeamEvaluationParams) error

LockTeamEvaluation takes the transaction advisory lock of the evaluation of the Teams (db.TeamEvaluationLockClass, keyed by the Organization) exclusively, before a batch of team_evaluation, organization_message_settings, team_name, organization_links, user_name, account_links or service_account_name lists its Alert Groups: it waits for every Snapshot in flight, which routing takes it shared for before it reads the stamp of the classification, so that the batch lists the Alert Groups those Snapshots created or changed.

func (*Queries) MissCallPageUsers

func (q *Queries) MissCallPageUsers(ctx context.Context, arg MissCallPageUsersParams) ([]int64, error)

MissCallPageUsers marks not_delivered, with the reason of its call, the person of a Page of the kind call still pending once the call ended Not delivered.

func (*Queries) MissPageUsers

func (q *Queries) MissPageUsers(ctx context.Context, arg MissPageUsersParams) ([]int64, error)

MissPageUsers marks not_delivered, with the reason not_delivered, the people of a Page still pending once every Thread reply of it ended without reaching them.

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

func (q *Queries) NextNumber(ctx context.Context, orgID int64) (int64, error)

NextNumber takes the next #N; a rollback returns it, so no gap appears.

func (*Queries) NextOpenGroupUpdate

func (q *Queries) NextOpenGroupUpdate(ctx context.Context, arg NextOpenGroupUpdateParams) (time.Time, error)

NextOpenGroupUpdate is when the next row of the kinds this replica handles can be claimed: now when one is free at the real time now, else the earliest end of a lease still held; the zero time 0001-01-01 when there is none.

func (*Queries) NotifyTimers

func (q *Queries) NotifyTimers(ctx context.Context, channel string) error

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) ReachPageUsers

func (q *Queries) ReachPageUsers(ctx context.Context, arg ReachPageUsersParams) ([]int64, error)

ReachPageUsers marks delivered the people of a Page still pending whom a delivered Thread reply mentioned.

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

func (q *Queries) RollbackGrouping(ctx context.Context) error

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, FR-28 to FR-30) aggregate the summary rows that started in [@range_from, @range_to) and match the filters, which the list resolves the same way: the Routes @route_ids, the Integrations @integration_ids (an overlap), the Severity levels @severities, @urgent, @reopened, with @team_set the Teams @team_ids, the = Matchers @contains, the User of the first acknowledgement @first_acknowledged_by, and with @ids_set only the Alert Groups @ids that passed the Matchers Go applies. Every aggregation starts from the period on alert_groups_started_idx. 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.

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

func (q *Queries) SavepointGrouping(ctx context.Context) error

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) SetChainGeneration

func (q *Queries) SetChainGeneration(ctx context.Context, arg SetChainGenerationParams) error

SetChainGeneration writes the start of the chains of an Alert Group that the re-render step found no Destination for, after the dispatcher saved it.

func (*Queries) SetPageCall

func (q *Queries) SetPageCall(ctx context.Context, arg SetPageCallParams) error

SetPageCall records the call through a Notification gateway that a Page of the kind call joined, whose end settles it.

func (*Queries) ShareRouteMembership

func (q *Queries) ShareRouteMembership(ctx context.Context, arg ShareRouteMembershipParams) error

The reach of an Alert Group (C-26.FR-2 to FR-5): the dispatcher reads it, under the Route's membership lock, after a transition that Alerts made, to record destination_joined in each Destination it reaches without a delivery yet. ShareRouteMembership takes, until the transaction ends, the shared membership lock of a Route (class db.RouteMembershipLockClass), which a change of its Destinations takes exclusively, before the reach is read: the dispatcher takes it after its lock of the Alert Group, the order Enqueue keeps, which takes it again.

func (*Queries) ShareRouteStorm

func (q *Queries) ShareRouteStorm(ctx context.Context, arg ShareRouteStormParams) ([]int64, error)

func (*Queries) ShareServiceAccount

func (q *Queries) ShareServiceAccount(ctx context.Context, arg ShareServiceAccountParams) ([]int64, error)

ShareServiceAccount locks the row of a Service account that snoozes, FOR SHARE, before the Alert Group: a rename of it, which locks the row and then writes the re-render of the open Alert Groups it snoozed, waits for the Snooze, or the Snooze renders the footer after the rename.

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 outcome of a Page locks its Alert Group (SettlePage), as a Snapshot does: a batch of user_name or account_links takes it exclusively before it lists, so it waits for the Assignees an outcome in flight makes, and an outcome that starts later renders their name and Account links after the change.

func (*Queries) ShareTeamMembership

func (q *Queries) ShareTeamMembership(ctx context.Context, arg ShareTeamMembershipParams) error

ShareTeamMembership takes, until the transaction ends, the shared membership lock of a Team (class db.TeamMembershipLockClass), which a change of the Team's Destination entries takes exclusively, before the Team's entries are read: after the Route's membership lock, by Team id.

func (*Queries) ShareUser

func (q *Queries) ShareUser(ctx context.Context, arg ShareUserParams) ([]int64, error)

ShareUser locks the row of a User who snoozes, FOR SHARE, before the Alert Group, as LockActiveUser does for who acknowledges: a change of the User's display name or Account links, which locks the row and then writes the re-render of the open Alert Groups whose footer names them, waits for the Snooze, whose Alert Group it then finds, or the Snooze renders the footer after the change.

func (*Queries) TeamStatistics

func (q *Queries) TeamStatistics(ctx context.Context, arg TeamStatisticsParams) ([]TeamStatisticsRow, error)

TeamStatistics aggregates the Alert Groups per Team of alert_group_teams — one with several Teams counts for each, one without a Team for none — only the Teams @team_ids with @team_set.

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) UpsertAssignee

func (q *Queries) UpsertAssignee(ctx context.Context, arg UpsertAssigneeParams) error

UpsertAssignee makes a person an Assignee of a run, or moves an Assignee to the step that reached them again, keeping since when they are one.

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.

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type ReachPageUsersParams

type ReachPageUsersParams struct {
	OrgID   int64
	PageID  int64
	UserIds []int64
}

type ResolveMembershipsParams

type ResolveMembershipsParams struct {
	EndedAt     time.Time
	OrgID       int64
	Ids         []int64
	Reasons     []string
	ReasonTexts []string
}

type RouteStatisticsParams

type RouteStatisticsParams struct {
	TimeZone            string
	OrgID               int64
	RangeFrom           time.Time
	RangeTo             time.Time
	RouteIds            []int64
	IntegrationIds      []int64
	Severities          []string
	Urgent              pgtype.Bool
	Reopened            pgtype.Bool
	TeamSet             bool
	TeamIds             []int64
	Contains            []byte
	FirstAcknowledgedBy pgtype.Int8
	IdsSet              bool
	Ids                 []int64
}

type RouteStatisticsRow

type RouteStatisticsRow struct {
	SubjectID       int64
	Day             pgtype.Date
	Total           bool
	AlertGroupCount int64
	ResolveCount    int64
	ResolveMedian   float64
	ResolveP95      float64
	AckCount        int64
	AckMedian       float64
	AckP95          float64
}

type SaveGroupParams

type SaveGroupParams struct {
	RouteID                        int64
	MovedFromRouteID               pgtype.Int8
	Title                          string
	TitleFromGroupKey              bool
	Summary                        pgtype.Text
	Description                    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
	FirstAcknowledgedByUserID      pgtype.Int8
	FirstPublishedAt               pgtype.Timestamptz
	AckTimeoutStartedAt            pgtype.Timestamptz
	AckTimeoutNoticesSent          int64
	Unclaimed                      bool
	RemindersSent                  int64
	RemindersUnanswered            int64
	LastReminderAt                 pgtype.Timestamptz
	OwnerAnsweredAt                pgtype.Timestamptz
	ChainGeneration                int64
	OrgID                          int64
	ID                             int64
}

type SetChainGenerationParams

type SetChainGenerationParams struct {
	ChainGeneration int64
	OrgID           int64
	ID              int64
}

type SetPageCallParams

type SetPageCallParams struct {
	GatewayCallID pgtype.Int8
	OrgID         int64
	ID            int64
}

type ShareRouteMembershipParams

type ShareRouteMembershipParams struct {
	LockClass int32
	RouteID   int64
}

type ShareRouteStormParams

type ShareRouteStormParams struct {
	OrgID   int64
	RouteID int64
}

type ShareServiceAccountParams

type ShareServiceAccountParams struct {
	OrgID int64
	ID    int64
}

type ShareTeamEvaluationParams

type ShareTeamEvaluationParams struct {
	LockClass int32
	OrgID     int64
}

type ShareTeamMembershipParams

type ShareTeamMembershipParams struct {
	LockClass int32
	TeamID    int64
}

type ShareUserParams

type ShareUserParams struct {
	OrgID int64
	ID    int64
}

type TeamStatisticsParams

type TeamStatisticsParams struct {
	TimeZone            string
	OrgID               int64
	RangeFrom           time.Time
	RangeTo             time.Time
	RouteIds            []int64
	IntegrationIds      []int64
	Severities          []string
	Urgent              pgtype.Bool
	Reopened            pgtype.Bool
	TeamSet             bool
	TeamIds             []int64
	Contains            []byte
	FirstAcknowledgedBy pgtype.Int8
	IdsSet              bool
	Ids                 []int64
}

type TeamStatisticsRow

type TeamStatisticsRow struct {
	SubjectID       int64
	Day             pgtype.Date
	Total           bool
	AlertGroupCount int64
	ResolveCount    int64
	ResolveMedian   float64
	ResolveP95      float64
	AckCount        int64
	AckMedian       float64
	AckP95          float64
}

type UpdateMembershipsParams

type UpdateMembershipsParams struct {
	OrgID       int64
	Ids         []int64
	StartsAts   []time.Time
	Annotations [][]byte
}

type UpsertAssigneeParams

type UpsertAssigneeParams struct {
	OrgID           int64
	AlertGroupID    int64
	EscalationRunID int64
	StepNumber      int32
	RunStepSeq      pgtype.Int4
	UserID          int64
	TeamID          pgtype.Int8
	Since           time.Time
}

type UpsertTimerParams

type UpsertTimerParams struct {
	OrgID        int64
	AlertGroupID int64
	Kind         string
	Deadline     time.Time
	NoticeNumber pgtype.Int8
	Now          time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL