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: 6 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 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 FindServiceAccountActorParams

type FindServiceAccountActorParams struct {
	OrgID    int64
	PublicID string
}

type FindUserActorParams

type FindUserActorParams struct {
	OrgID    int64
	PublicID string
}

type InsertAuditEntryParams

type InsertAuditEntryParams struct {
	OrgID                 int64
	PublicID              string
	At                    time.Time
	ActorKind             string
	ActorUserID           pgtype.Int8
	ActorServiceAccountID pgtype.Int8
	ActorName             pgtype.Text
	ApiTokenID            pgtype.Int8
	TokenName             pgtype.Text
	Transport             string
	Action                string
	ResourceType          pgtype.Text
	ResourcePublicID      pgtype.Text
	ResourceName          pgtype.Text
	Diff                  []byte
	Details               []byte
	SourceAddress         *netip.Addr
}

type ListAuditEntriesParams

type ListAuditEntriesParams struct {
	OrgID                 int64
	From                  pgtype.Timestamptz
	To                    pgtype.Timestamptz
	ActorUserID           pgtype.Int8
	ActorServiceAccountID pgtype.Int8
	Action                pgtype.Text
	ResourceType          pgtype.Text
	ResourceID            pgtype.Text
	BeforeAt              pgtype.Timestamptz
	BeforeID              pgtype.Int8
	PageSize              int32
}

type ListAuditEntriesRow

type ListAuditEntriesRow struct {
	ID                          int64
	PublicID                    string
	At                          time.Time
	ActorKind                   string
	ActorName                   pgtype.Text
	TokenName                   pgtype.Text
	Transport                   string
	Action                      string
	ResourceType                pgtype.Text
	ResourcePublicID            pgtype.Text
	ResourceName                pgtype.Text
	ResourceUserName            pgtype.Text
	ResourceUserStatus          pgtype.Text
	ContactUserStatus           pgtype.Text
	Diff                        []byte
	Details                     []byte
	ActorUserPublicID           pgtype.Text
	ActorUserName               pgtype.Text
	ActorServiceAccountPublicID pgtype.Text
	ActorServiceAccountName     pgtype.Text
	TokenPublicID               pgtype.Text
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) FindServiceAccountActor

func (q *Queries) FindServiceAccountActor(ctx context.Context, arg FindServiceAccountActorParams) (int64, error)

func (*Queries) FindUserActor

func (q *Queries) FindUserActor(ctx context.Context, arg FindUserActorParams) (int64, error)

FindUserActor resolves the public_id of a user, and FindServiceAccountActor that of a Service account, to the internal id the entries store.

func (*Queries) InsertAuditEntry

func (q *Queries) InsertAuditEntry(ctx context.Context, arg InsertAuditEntryParams) error

SPDX-License-Identifier: AGPL-3.0-only Copyright The Muster Authors

func (*Queries) ListAuditEntries

func (q *Queries) ListAuditEntries(ctx context.Context, arg ListAuditEntriesParams) ([]ListAuditEntriesRow, error)

ListAuditEntries is a page of entries, newest first by time and id, after the cursor (before_at, before_id) when one is given, with the filters that are set. The actor, and a user as the resource, show their current name, so that a deleted user appears as deleted-user-<id> (C-03.FR-13); rows are never rewritten. The status of a user resource lets the reader mask what deleting the user erased, for the whole page at once, and so does the status of the User whose contact at a Notification gateway an entry is about, whom its details name (C-30.FR-3).

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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