Documentation
¶
Index ¶
- type CountTruncatedGroupsOfParams
- type CountTruncatedGroupsOfRow
- type DBTX
- type DeleteIntegrationParams
- type EnsureBuiltinParams
- type EnsureIntegrationTokenParams
- type FindIngestTokenParams
- type FindIngestTokenRow
- type FindIntegrationByNameParams
- type GetIntegrationParams
- type GetIntegrationRow
- type InsertIntegrationParams
- type InsertIntegrationTokenParams
- type LastSnapshotTimesParams
- type LastSnapshotTimesRow
- type ListIntegrationInfoRow
- type ListIntegrationTokensParams
- type ListIntegrationTokensRow
- type ListIntegrationsParams
- type ListIntegrationsRow
- type ListLongRepeatRoutesParams
- type ListLongRepeatRoutesRow
- type LockIntegrationParams
- type Queries
- func (q *Queries) CountTruncatedGroupsOf(ctx context.Context, arg CountTruncatedGroupsOfParams) ([]CountTruncatedGroupsOfRow, error)
- func (q *Queries) DeleteIntegration(ctx context.Context, arg DeleteIntegrationParams) error
- func (q *Queries) EnsureBuiltin(ctx context.Context, arg EnsureBuiltinParams) (string, error)
- func (q *Queries) EnsureIntegrationToken(ctx context.Context, arg EnsureIntegrationTokenParams) (string, error)
- func (q *Queries) FindIngestToken(ctx context.Context, arg FindIngestTokenParams) (FindIngestTokenRow, error)
- func (q *Queries) FindIntegrationByName(ctx context.Context, arg FindIntegrationByNameParams) (string, error)
- func (q *Queries) GetIntegration(ctx context.Context, arg GetIntegrationParams) (GetIntegrationRow, error)
- func (q *Queries) InsertIntegration(ctx context.Context, arg InsertIntegrationParams) (int64, error)
- func (q *Queries) InsertIntegrationToken(ctx context.Context, arg InsertIntegrationTokenParams) (int64, error)
- func (q *Queries) LastSnapshotTimes(ctx context.Context, arg LastSnapshotTimesParams) ([]LastSnapshotTimesRow, error)
- func (q *Queries) ListIntegrationInfo(ctx context.Context, orgID int64) ([]ListIntegrationInfoRow, error)
- func (q *Queries) ListIntegrationTokens(ctx context.Context, arg ListIntegrationTokensParams) ([]ListIntegrationTokensRow, error)
- func (q *Queries) ListIntegrations(ctx context.Context, arg ListIntegrationsParams) ([]ListIntegrationsRow, error)
- func (q *Queries) ListLongRepeatRoutes(ctx context.Context, arg ListLongRepeatRoutesParams) ([]ListLongRepeatRoutesRow, error)
- func (q *Queries) LockDemo(ctx context.Context, key int64) error
- func (q *Queries) LockIntegration(ctx context.Context, arg LockIntegrationParams) (int64, error)
- func (q *Queries) RevokeIntegrationToken(ctx context.Context, arg RevokeIntegrationTokenParams) (RevokeIntegrationTokenRow, error)
- func (q *Queries) TouchIntegrationToken(ctx context.Context, arg TouchIntegrationTokenParams) error
- func (q *Queries) UpdateIntegration(ctx context.Context, arg UpdateIntegrationParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RevokeIntegrationTokenParams
- type RevokeIntegrationTokenRow
- type TouchIntegrationTokenParams
- type UpdateIntegrationParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteIntegrationParams ¶
type EnsureBuiltinParams ¶
type FindIngestTokenParams ¶
type FindIngestTokenRow ¶
type FindIngestTokenRow struct {
ID int64
TokenHash []byte
RevokedAt pgtype.Timestamptz
LastUsedAt pgtype.Timestamptz
IntegrationID int64
IntegrationPublicID string
IntegrationDeletedAt pgtype.Timestamptz
}
type GetIntegrationParams ¶
type GetIntegrationRow ¶
type GetIntegrationRow struct {
ID int64
PublicID string
Name string
Description string
Builtin bool
ConnectionMode string
StaticLabels []byte
DuplicateWindowSeconds int64
HeartbeatEnabled bool
HeartbeatTimeoutSeconds int64
HeartbeatState string
HeartbeatLastSignalAt pgtype.Timestamptz
HeartbeatLostSince pgtype.Timestamptz
SnapshotCount int64
CreatedAt time.Time
Version int64
}
type InsertIntegrationParams ¶
type LastSnapshotTimesParams ¶
type LastSnapshotTimesRow ¶
type ListIntegrationInfoRow ¶
type ListIntegrationsParams ¶
type ListIntegrationsRow ¶
type ListIntegrationsRow struct {
ID int64
PublicID string
Name string
Description string
Builtin bool
ConnectionMode string
StaticLabels []byte
DuplicateWindowSeconds int64
HeartbeatEnabled bool
HeartbeatTimeoutSeconds int64
HeartbeatState string
HeartbeatLastSignalAt pgtype.Timestamptz
HeartbeatLostSince pgtype.Timestamptz
SnapshotCount int64
CreatedAt time.Time
Version int64
}
type ListLongRepeatRoutesRow ¶
type LockIntegrationParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountTruncatedGroupsOf ¶
func (q *Queries) CountTruncatedGroupsOf(ctx context.Context, arg CountTruncatedGroupsOfParams) ([]CountTruncatedGroupsOfRow, error)
CountTruncatedGroupsOf counts the truncated groupKeys of each of the Integrations that has one (the warning snapshot_truncated).
func (*Queries) DeleteIntegration ¶
func (q *Queries) DeleteIntegration(ctx context.Context, arg DeleteIntegrationParams) error
DeleteIntegration marks an Integration deleted; its row, its tokens and its Stored Snapshots stay.
func (*Queries) EnsureBuiltin ¶
EnsureBuiltin creates the built-in "Muster" Integration of the Organization once: webhook-only, without Static labels and with the Heartbeat off. It returns no row when it exists.
func (*Queries) EnsureIntegrationToken ¶
func (q *Queries) EnsureIntegrationToken(ctx context.Context, arg EnsureIntegrationTokenParams) (string, error)
EnsureIntegrationToken stores a token of the development demo, or gives the stored one back to the Integration and takes back its revocation; it returns the token's public_id when it wrote a row, and no row otherwise.
func (*Queries) FindIngestToken ¶
func (q *Queries) FindIngestToken(ctx context.Context, arg FindIngestTokenParams) (FindIngestTokenRow, error)
FindIngestToken finds an Integration token by the SHA-256 of its value, with what ingestion decides on: whether the token is revoked, and the Integration with its deletion.
func (*Queries) FindIntegrationByName ¶
func (q *Queries) FindIntegrationByName(ctx context.Context, arg FindIntegrationByNameParams) (string, error)
FindIntegrationByName returns the public_id of the Integration that is not deleted and has the name.
func (*Queries) GetIntegration ¶
func (q *Queries) GetIntegration(ctx context.Context, arg GetIntegrationParams) (GetIntegrationRow, error)
GetIntegration reads an Integration that is not deleted.
func (*Queries) InsertIntegration ¶
func (q *Queries) InsertIntegration(ctx context.Context, arg InsertIntegrationParams) (int64, error)
InsertIntegration creates an Integration; a Heartbeat that is on waits for its first signal.
func (*Queries) InsertIntegrationToken ¶
func (q *Queries) InsertIntegrationToken(ctx context.Context, arg InsertIntegrationTokenParams) (int64, error)
InsertIntegrationToken stores an Integration token by the SHA-256 of its value.
func (*Queries) LastSnapshotTimes ¶
func (q *Queries) LastSnapshotTimes(ctx context.Context, arg LastSnapshotTimesParams) ([]LastSnapshotTimesRow, error)
LastSnapshotTimes returns the time of the newest Stored Snapshot of each of the Integrations that has one, each read through the list index of its Integration.
func (*Queries) ListIntegrationInfo ¶
func (q *Queries) ListIntegrationInfo(ctx context.Context, orgID int64) ([]ListIntegrationInfoRow, error)
ListIntegrationInfo lists the id, the name and whether it is built in of every Integration that is not deleted, for muster_integration_info and the series of muster_ingest_requests_total.
func (*Queries) ListIntegrationTokens ¶
func (q *Queries) ListIntegrationTokens(ctx context.Context, arg ListIntegrationTokensParams) ([]ListIntegrationTokensRow, error)
ListIntegrationTokens lists the tokens of an Integration that are not revoked, the newest first.
func (*Queries) ListIntegrations ¶
func (q *Queries) ListIntegrations(ctx context.Context, arg ListIntegrationsParams) ([]ListIntegrationsRow, error)
SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors ListIntegrations lists the Integrations that are not deleted, in the order they were created, after the cursor when one is given.
func (*Queries) ListLongRepeatRoutes ¶
func (q *Queries) ListLongRepeatRoutes(ctx context.Context, arg ListLongRepeatRoutesParams) ([]ListLongRepeatRoutesRow, error)
ListLongRepeatRoutes lists the Alertmanager routes of the Integrations whose learned repeat interval is above @threshold_ms (the warning long_repeat_interval), in the order of their paths.
func (*Queries) LockDemo ¶
LockDemo serializes the demo start-up step of replicas that start together, until the transaction ends.
func (*Queries) LockIntegration ¶
LockIntegration locks an Integration that is not deleted for a change and returns its id.
func (*Queries) RevokeIntegrationToken ¶
func (q *Queries) RevokeIntegrationToken(ctx context.Context, arg RevokeIntegrationTokenParams) (RevokeIntegrationTokenRow, error)
RevokeIntegrationToken revokes a token of an Integration that is not revoked yet and returns its name.
func (*Queries) TouchIntegrationToken ¶
func (q *Queries) TouchIntegrationToken(ctx context.Context, arg TouchIntegrationTokenParams) error
TouchIntegrationToken records the use of a token, at most once a minute: a row used since @stale_before is left alone.
func (*Queries) UpdateIntegration ¶
func (q *Queries) UpdateIntegration(ctx context.Context, arg UpdateIntegrationParams) error
UpdateIntegration replaces the configured fields. The Heartbeat state follows its setting (C-07.FR-3): turned on from not_configured it waits for the first signal, turned off it is not_configured and no longer lost; otherwise the runtime state (Heartbeat state, liveness clock, counters) is left alone.