auditstorage

package
v0.0.0-...-c6a46fa Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuditEventsStorage

func NewAuditEventsStorage(db *gorm.DB, logger *logging.Logger) auditsvc.AuditEventsStorage

func NewAuditOutboxEventsOutbox

func NewAuditOutboxEventsOutbox(db *gorm.DB, processors []txoutbox.MessageProcessor) auditsvc.AuditOutboxEventsOutbox

func NewAuditRetentionSettingsStorage

func NewAuditRetentionSettingsStorage(db *gorm.DB, logger *logging.Logger) auditsvc.AuditRetentionSettingsStorage

func NewTableGenerators

func NewTableGenerators() table.GeneratorList

Types

type EventPageStorage

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

EventPageStorage lists audit events with row-offset pagination.

func NewEventPageStorage

func NewEventPageStorage(db *gorm.DB) *EventPageStorage

func (*EventPageStorage) FindPage

func (s *EventPageStorage) FindPage(ctx context.Context, flt *auditservice.AuditEventFilter, offset, limit int) ([]*auditservice.AuditEvent, error)

type PendingEventStorage

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

PendingEventStorage moves pending audit events into a workspace.

func NewPendingEventStorage

func NewPendingEventStorage(db *gorm.DB) *PendingEventStorage

func (*PendingEventStorage) AdoptPendingEvents

func (s *PendingEventStorage) AdoptPendingEvents(ctx context.Context, userID, workspaceID uuid.UUID, until time.Time) (int64, error)

type RetentionStorage

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

RetentionStorage runs the bulk queries behind audit retention cleanup.

func NewRetentionStorage

func NewRetentionStorage(db *gorm.DB) *RetentionStorage

func (*RetentionStorage) DeleteOlderThan

func (s *RetentionStorage) DeleteOlderThan(ctx context.Context, workspaceID uuid.UUID, cutoff time.Time) (int64, error)

func (*RetentionStorage) DistinctWorkspaceIDs

func (s *RetentionStorage) DistinctWorkspaceIDs(ctx context.Context) ([]uuid.UUID, error)

type Storages

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

func NewStorages

func NewStorages(db *gorm.DB, logger *logging.Logger, processors []txoutbox.MessageProcessor) *Storages

func (Storages) AuditEvents

func (s Storages) AuditEvents() auditsvc.AuditEventsStorage

func (Storages) AuditOutboxEvents

func (s Storages) AuditOutboxEvents() auditsvc.AuditOutboxEventsOutbox

func (Storages) AuditRetentionSettings

func (s Storages) AuditRetentionSettings() auditsvc.AuditRetentionSettingsStorage

func (Storages) ExecuteInTransaction

func (s Storages) ExecuteInTransaction(ctx context.Context, cb func(ctx context.Context, tx auditsvc.Storage) error) error

func (Storages) IdempotencyKeys

func (s Storages) IdempotencyKeys() idempotency.Storage

func (*Storages) WithAdvisoryLock

func (s *Storages) WithAdvisoryLock(ctx context.Context, scope string, lockID int64) error

Jump to

Keyboard shortcuts

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