dbgen

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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 BumpDestinationVersionParams

type BumpDestinationVersionParams struct {
	Now   time.Time
	OrgID int64
	ID    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 DeleteSecretParams

type DeleteSecretParams struct {
	OrgID         int64
	DestinationID int64
	Name          string
}

type GetBodyServiceAccountParams

type GetBodyServiceAccountParams struct {
	OrgID int64
	ID    int64
}

type GetBodyServiceAccountRow

type GetBodyServiceAccountRow struct {
	PublicID string
	Name     string
}

type GetBodyUserParams

type GetBodyUserParams struct {
	OrgID int64
	ID    int64
}

type GetBodyUserRow

type GetBodyUserRow struct {
	PublicID string
	Name     string
	Login    string
}

type GetTargetParams

type GetTargetParams struct {
	OrgID int64
	ID    int64
}

type GetTargetRow

type GetTargetRow struct {
	ID                              int64
	PublicID                        string
	WebhookMode                     pgtype.Text
	WebhookEventsConfig             []byte
	WebhookTemplateConfig           []byte
	Proxy                           []byte
	ProxyPasswordCiphertext         []byte
	ProxyPasswordKeyID              pgtype.Text
	SigningSecretCiphertext         []byte
	SigningSecretKeyID              pgtype.Text
	PreviousSigningSecretCiphertext []byte
	PreviousSigningSecretKeyID      pgtype.Text
}

type GetTemplateConfigParams

type GetTemplateConfigParams struct {
	OrgID int64
	ID    int64
}

type GetWebhookDestinationParams

type GetWebhookDestinationParams struct {
	OrgID    int64
	PublicID string
}

type GetWebhookDestinationRow

type GetWebhookDestinationRow struct {
	ID                         int64
	PublicID                   string
	Name                       string
	Type                       string
	Version                    int64
	SigningSecretSet           bool
	SigningSecretUpdatedAt     pgtype.Timestamptz
	PreviousSigningSecretSince pgtype.Timestamptz
}

type ListBodyAlertsParams

type ListBodyAlertsParams struct {
	OrgID        int64
	AlertGroupID int64
}

type ListBodyAlertsRow

type ListBodyAlertsRow struct {
	Fingerprint   string
	Labels        []byte
	Annotations   []byte
	StartsAt      time.Time
	EndedAt       pgtype.Timestamptz
	ResolveReason pgtype.Text
	GeneratorUrl  pgtype.Text
	State         string
}

type ListSecretValuesParams

type ListSecretValuesParams struct {
	OrgID         int64
	DestinationID int64
}

type ListSecretValuesRow

type ListSecretValuesRow struct {
	Name            string
	ValueCiphertext []byte
	ValueKeyID      string
}

type ListSecretsParams

type ListSecretsParams struct {
	OrgID         int64
	DestinationID int64
}

type ListSecretsRow

type ListSecretsRow struct {
	Name           string
	ValueUpdatedAt time.Time
}

type LockWebhookDestinationParams

type LockWebhookDestinationParams struct {
	OrgID    int64
	PublicID string
}

type LockWebhookDestinationRow

type LockWebhookDestinationRow struct {
	ID                         int64
	PublicID                   string
	Name                       string
	Type                       string
	Version                    int64
	SigningSecretCiphertext    []byte
	SigningSecretKeyID         pgtype.Text
	SigningSecretUpdatedAt     pgtype.Timestamptz
	PreviousSigningSecretSince pgtype.Timestamptz
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BumpDestinationVersion

func (q *Queries) BumpDestinationVersion(ctx context.Context, arg BumpDestinationVersionParams) (int64, error)

BumpDestinationVersion gives a Destination whose Secrets changed its next version, the ETag of its Secrets.

func (*Queries) DeleteSecret

func (q *Queries) DeleteSecret(ctx context.Context, arg DeleteSecretParams) (int64, error)

DeleteSecret deletes a Secret of a Destination; no row when it does not exist.

func (*Queries) GetBodyServiceAccount

func (q *Queries) GetBodyServiceAccount(ctx context.Context, arg GetBodyServiceAccountParams) (GetBodyServiceAccountRow, error)

GetBodyServiceAccount reads a Service account as the body of an event names it.

func (*Queries) GetBodyUser

func (q *Queries) GetBodyUser(ctx context.Context, arg GetBodyUserParams) (GetBodyUserRow, error)

GetBodyUser reads a User as the body of an event names them.

func (*Queries) GetTarget

func (q *Queries) GetTarget(ctx context.Context, arg GetTargetParams) (GetTargetRow, error)

GetTarget reads what a request of an outgoing webhook needs, in either mode, deleted or not: a call in flight when it was deleted still signs with its secrets, which delivery wipes once no call of it holds a lease.

func (*Queries) GetTemplateConfig

func (q *Queries) GetTemplateConfig(ctx context.Context, arg GetTemplateConfigParams) ([]byte, error)

GetTemplateConfig reads the request templates of an outgoing webhook, deleted or not, through the transaction of a change, to render the Desired state of its template mode; null in the events mode.

func (*Queries) GetWebhookDestination

func (q *Queries) GetWebhookDestination(ctx context.Context, arg GetWebhookDestinationParams) (GetWebhookDestinationRow, error)

SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors Outgoing webhooks (C-15): the Signing secrets and the named Secrets of an outgoing webhook Destination, what an events-mode request needs of its Destination, and what the version 1 body reads of an Alert Group. Secret values are read only to send a request; the API reads their status. GetWebhookDestination reads a Destination that is not deleted, of any type, with the status of its Signing secrets.

func (*Queries) ListBodyAlerts

func (q *Queries) ListBodyAlerts(ctx context.Context, arg ListBodyAlertsParams) ([]ListBodyAlertsRow, error)

ListBodyAlerts lists the Alerts of an Alert Group for the body of an event, one per fingerprint with its latest membership, Alerts that moved to another Alert Group left out, by fingerprint.

func (*Queries) ListSecretValues

func (q *Queries) ListSecretValues(ctx context.Context, arg ListSecretValuesParams) ([]ListSecretValuesRow, error)

ListSecretValues reads the encrypted values of the Secrets of a Destination, by name.

func (*Queries) ListSecrets

func (q *Queries) ListSecrets(ctx context.Context, arg ListSecretsParams) ([]ListSecretsRow, error)

ListSecrets lists the names of the Secrets of a Destination with the time of their last change, by name.

func (*Queries) LockWebhookDestination

func (q *Queries) LockWebhookDestination(ctx context.Context, arg LockWebhookDestinationParams) (LockWebhookDestinationRow, error)

LockWebhookDestination locks a Destination that is not deleted, of any type, for a change of its secrets, with its Signing secrets.

func (*Queries) RetirePreviousSigningSecret

func (q *Queries) RetirePreviousSigningSecret(ctx context.Context, arg RetirePreviousSigningSecretParams) (int64, error)

RetirePreviousSigningSecret wipes the previous Signing secret, which signs no more. No row when there is none.

func (*Queries) RotateSigningSecret

func (q *Queries) RotateSigningSecret(ctx context.Context, arg RotateSigningSecretParams) (int64, error)

RotateSigningSecret makes the current Signing secret the previous one, which still signs since @now — none when it had none — and stores the new one, and gives the Destination its next version.

func (*Queries) UpsertSecret

func (q *Queries) UpsertSecret(ctx context.Context, arg UpsertSecretParams) error

UpsertSecret creates or replaces a Secret of a Destination.

func (*Queries) WithTx

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

type RetirePreviousSigningSecretParams

type RetirePreviousSigningSecretParams struct {
	Now   time.Time
	OrgID int64
	ID    int64
}

type RotateSigningSecretParams

type RotateSigningSecretParams struct {
	PreviousCiphertext []byte
	PreviousKeyID      pgtype.Text
	Now                time.Time
	Ciphertext         []byte
	KeyID              pgtype.Text
	OrgID              int64
	ID                 int64
}

type UpsertSecretParams

type UpsertSecretParams struct {
	DestinationID   int64
	OrgID           int64
	Name            string
	ValueCiphertext []byte
	ValueKeyID      string
	Now             time.Time
}

Jump to

Keyboard shortcuts

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