Documentation
¶
Index ¶
- type CountNewerOfConnectionParams
- type CountNewerOfDestinationParams
- type CountNewerUnownedParams
- type DBTX
- type FindConnectionParams
- type FindDestinationParams
- type FindDestinationRow
- type GetRecordParams
- type GetRecordRow
- type InsertRecordParams
- type ListConnectionRecordsParams
- type ListConnectionRecordsRow
- type ListDestinationRecordsParams
- type ListDestinationRecordsRow
- type ListRunRecordsParams
- type ListRunRecordsRow
- type PruneConnectionExcessParams
- type PruneDestinationExcessParams
- type PruneOlderParams
- type PruneUnownedExcessParams
- type Queries
- func (q *Queries) CountNewerOfConnection(ctx context.Context, arg CountNewerOfConnectionParams) (int64, error)
- func (q *Queries) CountNewerOfDestination(ctx context.Context, arg CountNewerOfDestinationParams) (int64, error)
- func (q *Queries) CountNewerUnowned(ctx context.Context, arg CountNewerUnownedParams) (int64, error)
- func (q *Queries) FindConnection(ctx context.Context, arg FindConnectionParams) (int64, error)
- func (q *Queries) FindDestination(ctx context.Context, arg FindDestinationParams) (FindDestinationRow, error)
- func (q *Queries) GetRecord(ctx context.Context, arg GetRecordParams) (GetRecordRow, error)
- func (q *Queries) InsertRecord(ctx context.Context, arg InsertRecordParams) error
- func (q *Queries) ListConnectionIDs(ctx context.Context, orgID int64) ([]int64, error)
- func (q *Queries) ListConnectionRecords(ctx context.Context, arg ListConnectionRecordsParams) ([]ListConnectionRecordsRow, error)
- func (q *Queries) ListDestinationRecords(ctx context.Context, arg ListDestinationRecordsParams) ([]ListDestinationRecordsRow, error)
- func (q *Queries) ListRunRecords(ctx context.Context, arg ListRunRecordsParams) ([]ListRunRecordsRow, error)
- func (q *Queries) ListWebhookDestinationIDs(ctx context.Context, orgID int64) ([]int64, error)
- func (q *Queries) PruneConnectionExcess(ctx context.Context, arg PruneConnectionExcessParams) (int64, error)
- func (q *Queries) PruneDestinationExcess(ctx context.Context, arg PruneDestinationExcessParams) (int64, error)
- func (q *Queries) PruneOlder(ctx context.Context, arg PruneOlderParams) (int64, error)
- func (q *Queries) PruneUnownedExcess(ctx context.Context, arg PruneUnownedExcessParams) (int64, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountNewerUnownedParams ¶
type FindConnectionParams ¶
type FindDestinationParams ¶
type FindDestinationRow ¶
type GetRecordParams ¶
type GetRecordRow ¶
type GetRecordRow struct {
ID int64
PublicID string
At time.Time
Direction string
Operation string
CheckKind pgtype.Text
CheckRun pgtype.Text
Method string
Url string
RequestHeaders []byte
RequestBody string
RequestBodyBytes int64
RequestBodyTruncated bool
Status pgtype.Int4
ResponseHeaders []byte
ResponseBody pgtype.Text
ResponseBodyBytes int64
ResponseBodyTruncated bool
LatencyMs int32
Via string
Attempt int32
ErrorClass pgtype.Text
ErrorCode pgtype.Text
Error pgtype.Text
ConnectionID pgtype.Int8
DestinationID pgtype.Int8
ConnectionPublicID pgtype.Text
ConnectionDeletedAt pgtype.Timestamptz
DestinationPublicID pgtype.Text
DestinationName pgtype.Text
DestinationType pgtype.Text
DestinationHealth pgtype.Text
DestinationBrokenSince pgtype.Timestamptz
DestinationBrokenReason pgtype.Text
DestinationDeletedAt pgtype.Timestamptz
AlertGroupPublicID pgtype.Text
AlertGroupNumber pgtype.Int8
}
type InsertRecordParams ¶
type InsertRecordParams struct {
OrgID int64
PublicID string
At time.Time
Direction string
Operation string
Method string
Url string
RequestHeaders []byte
RequestBody string
RequestBodyBytes int64
RequestBodyTruncated bool
Status pgtype.Int4
ResponseHeaders []byte
ResponseBody pgtype.Text
ResponseBodyBytes int64
ResponseBodyTruncated bool
LatencyMs int32
Via string
Attempt int32
ErrorClass pgtype.Text
ErrorCode pgtype.Text
Error pgtype.Text
ConnectionID pgtype.Int8
DestinationID pgtype.Int8
AlertGroupID pgtype.Int8
CheckKind pgtype.Text
CheckRun pgtype.Text
}
type ListConnectionRecordsParams ¶
type ListConnectionRecordsParams struct {
OrgID int64
DestinationID pgtype.Int8
Direction pgtype.Text
NoAnswer bool
StatusFrom pgtype.Int4
StatusTo pgtype.Int4
Operation pgtype.Text
AlertGroup pgtype.Text
CheckRun pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
PageSize int32
ConnectionID int64
NotBefore time.Time
MaxRecords int32
}
type ListConnectionRecordsRow ¶
type ListConnectionRecordsRow struct {
ID int64
PublicID string
At time.Time
Direction string
Operation string
CheckKind pgtype.Text
CheckRun pgtype.Text
Method string
Url string
Status pgtype.Int4
LatencyMs int32
Via string
Attempt int32
ErrorClass pgtype.Text
ErrorCode pgtype.Text
RequestBodyTruncated bool
ResponseBodyTruncated bool
ConnectionPublicID pgtype.Text
DestinationPublicID pgtype.Text
DestinationName pgtype.Text
DestinationType pgtype.Text
DestinationHealth pgtype.Text
DestinationBrokenSince pgtype.Timestamptz
DestinationBrokenReason pgtype.Text
AlertGroupPublicID pgtype.Text
AlertGroupNumber pgtype.Int8
}
type ListDestinationRecordsParams ¶
type ListDestinationRecordsParams struct {
OrgID int64
Direction pgtype.Text
NoAnswer bool
StatusFrom pgtype.Int4
StatusTo pgtype.Int4
Operation pgtype.Text
AlertGroup pgtype.Text
CheckRun pgtype.Text
AfterAt pgtype.Timestamptz
AfterID pgtype.Int8
PageSize int32
DestinationID int64
NotBefore time.Time
MaxRecords int32
}
type ListDestinationRecordsRow ¶
type ListDestinationRecordsRow struct {
ID int64
PublicID string
At time.Time
Direction string
Operation string
CheckKind pgtype.Text
CheckRun pgtype.Text
Method string
Url string
Status pgtype.Int4
LatencyMs int32
Via string
Attempt int32
ErrorClass pgtype.Text
ErrorCode pgtype.Text
RequestBodyTruncated bool
ResponseBodyTruncated bool
ConnectionPublicID pgtype.Text
DestinationPublicID pgtype.Text
DestinationName pgtype.Text
DestinationType pgtype.Text
DestinationHealth pgtype.Text
DestinationBrokenSince pgtype.Timestamptz
DestinationBrokenReason pgtype.Text
AlertGroupPublicID pgtype.Text
AlertGroupNumber pgtype.Int8
}
type ListRunRecordsParams ¶
type ListRunRecordsRow ¶
type ListRunRecordsRow struct {
ID int64
PublicID string
At time.Time
Direction string
Operation string
CheckKind pgtype.Text
CheckRun pgtype.Text
Method string
Url string
Status pgtype.Int4
LatencyMs int32
Via string
Attempt int32
ErrorClass pgtype.Text
ErrorCode pgtype.Text
RequestBodyTruncated bool
ResponseBodyTruncated bool
ConnectionPublicID pgtype.Text
DestinationPublicID pgtype.Text
DestinationName pgtype.Text
DestinationType pgtype.Text
DestinationHealth pgtype.Text
DestinationBrokenSince pgtype.Timestamptz
DestinationBrokenReason pgtype.Text
AlertGroupPublicID pgtype.Text
AlertGroupNumber pgtype.Int8
}
type PruneOlderParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountNewerOfConnection ¶
func (q *Queries) CountNewerOfConnection(ctx context.Context, arg CountNewerOfConnectionParams) (int64, error)
CountNewerOfConnection counts, up to @max_records, the records of the Connection newer than (@at, @id): a record with @max_records newer ones is past the count bound.
func (*Queries) CountNewerOfDestination ¶
func (q *Queries) CountNewerOfDestination(ctx context.Context, arg CountNewerOfDestinationParams) (int64, error)
CountNewerOfDestination counts the newer records of an outgoing webhook Destination as CountNewerOfConnection does.
func (*Queries) CountNewerUnowned ¶
func (q *Queries) CountNewerUnowned(ctx context.Context, arg CountNewerUnownedParams) (int64, error)
CountNewerUnowned counts the newer records without an owner as CountNewerOfConnection does.
func (*Queries) FindConnection ¶
FindConnection reads the id of a Connection that is not deleted.
func (*Queries) FindDestination ¶
func (q *Queries) FindDestination(ctx context.Context, arg FindDestinationParams) (FindDestinationRow, error)
FindDestination reads a Destination that is not deleted: its id, its type and its Connection, null for an outgoing webhook.
func (*Queries) GetRecord ¶
func (q *Queries) GetRecord(ctx context.Context, arg GetRecordParams) (GetRecordRow, error)
GetRecord reads a record that is not older than @not_before, with what its owner's bound and Permission need: the deletion of its Connection and of its Destination.
func (*Queries) InsertRecord ¶
func (q *Queries) InsertRecord(ctx context.Context, arg InsertRecordParams) error
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors The Request log (C-23): one row per request, masked before it is written. A record's owner is its Connection, else its outgoing webhook Destination, else nobody (the checks before saving of new Connections); reads show only the records newer than request_log.max_age among the newest request_log.max_records of their owner, and the pruning deletes the rest.
func (*Queries) ListConnectionIDs ¶
ListConnectionIDs lists every Connection of the Organization, deleted ones included: each owns its records.
func (*Queries) ListConnectionRecords ¶
func (q *Queries) ListConnectionRecords(ctx context.Context, arg ListConnectionRecordsParams) ([]ListConnectionRecordsRow, error)
ListConnectionRecords lists, newest first, the records among the newest @max_records of the Connection that are not older than @not_before, after the cursor and filtered — by @destination_id for the view of a messenger Destination, and by a check run. The bounded set is chosen once, in a materialized CTE, so the filters scan at most @max_records rows.
func (*Queries) ListDestinationRecords ¶
func (q *Queries) ListDestinationRecords(ctx context.Context, arg ListDestinationRecordsParams) ([]ListDestinationRecordsRow, error)
ListDestinationRecords lists the records of an outgoing webhook Destination as ListConnectionRecords lists those of a Connection, filtered by a check run too.
func (*Queries) ListRunRecords ¶
func (q *Queries) ListRunRecords(ctx context.Context, arg ListRunRecordsParams) ([]ListRunRecordsRow, error)
ListRunRecords lists, newest first, the records of the check run @check_run that connections:read reads — those of a Connection that is not deleted and those without an owner — that are not older than @not_before and are among the newest @max_records of their owner, after the cursor and filtered. A run has a handful of records, found through the age bound and the run; each is held to its owner's count bound by counting at most @max_records newer records of that owner, as getRequestRecord does. The records of an outgoing webhook's runs are listed by its Destination.
func (*Queries) ListWebhookDestinationIDs ¶
ListWebhookDestinationIDs lists every outgoing webhook Destination of the Organization, deleted ones included.
func (*Queries) PruneConnectionExcess ¶
func (q *Queries) PruneConnectionExcess(ctx context.Context, arg PruneConnectionExcessParams) (int64, error)
PruneConnectionExcess deletes up to @batch_size records of the Connection older than the oldest of its newest @max_records (edge), which a run never touches; with fewer records the edge is the oldest one and nothing goes. Both choices are made once, in materialized CTEs, as in PruneOlder.
func (*Queries) PruneDestinationExcess ¶
func (q *Queries) PruneDestinationExcess(ctx context.Context, arg PruneDestinationExcessParams) (int64, error)
PruneDestinationExcess deletes the records of an outgoing webhook Destination past the count bound as PruneConnectionExcess does.
func (*Queries) PruneOlder ¶
PruneOlder deletes up to @batch_size records older than @before. The batch is chosen once, in a materialized CTE: a subquery that a plan scans again for each deleted row skips the rows the statement already deleted, as locked by itself, and takes more than the batch.
func (*Queries) PruneUnownedExcess ¶
func (q *Queries) PruneUnownedExcess(ctx context.Context, arg PruneUnownedExcessParams) (int64, error)
PruneUnownedExcess deletes the records without an owner past the count bound as PruneConnectionExcess does.