activitylogsql

package
v0.0.0-...-46fdbbc Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityLogEntry

type ActivityLogEntry struct {
	ID           uuid.UUID
	CreatedAt    pgtype.Timestamptz
	Actor        string
	Action       string
	ResourceType string
	ResourceName string
	TeamSlug     *slug.Slug
	Data         []byte
	Environment  *string
}

type CreateParams

type CreateParams struct {
	Actor           string
	Action          string
	ResourceType    string
	ResourceName    string
	TeamSlug        *slug.Slug
	EnvironmentName *string
	Data            []byte
}

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 ListForResourceParams

type ListForResourceParams struct {
	ResourceType string
	ResourceName string
	Offset       int32
	Limit        int32
}

type ListForResourceRow

type ListForResourceRow struct {
	ActivityLogEntry ActivityLogEntry
	TotalCount       int64
}

type ListForTeamParams

type ListForTeamParams struct {
	TeamSlug *slug.Slug
	Offset   int32
	Limit    int32
}

type ListForTeamRow

type ListForTeamRow struct {
	ActivityLogEntry ActivityLogEntry
	TotalCount       int64
}

type Querier

type Querier interface {
	Create(ctx context.Context, arg CreateParams) error
	Get(ctx context.Context, id uuid.UUID) (*ActivityLogEntry, error)
	ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*ActivityLogEntry, error)
	ListForResource(ctx context.Context, arg ListForResourceParams) ([]*ListForResourceRow, error)
	ListForTeam(ctx context.Context, arg ListForTeamParams) ([]*ListForTeamRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) error

func (*Queries) Get

func (q *Queries) Get(ctx context.Context, id uuid.UUID) (*ActivityLogEntry, error)

func (*Queries) ListByIDs

func (q *Queries) ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*ActivityLogEntry, error)

func (*Queries) ListForResource

func (q *Queries) ListForResource(ctx context.Context, arg ListForResourceParams) ([]*ListForResourceRow, error)

func (*Queries) ListForTeam

func (q *Queries) ListForTeam(ctx context.Context, arg ListForTeamParams) ([]*ListForTeamRow, error)

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