Versions in this module Expand all Collapse all v0 v0.1.0 Nov 21, 2026 Changes in this version + var ErrNoMatch = errors.New("no matching rows for cleanup") + func InsertCleanupHistory(ctx context.Context, tx *sql.Tx, capture CaptureContext, sourcePKs []string, ...) ([]int64, error) + type CaptureContext struct + ActorKeyPrefix string + Diagnostic string + RequestID string + SourceTable string + type CleanupMode string + const ModeHard + const ModeSoft + func ParseMode(s string) (CleanupMode, error) + type CleanupRequest struct + All bool + IDs []string + Mode CleanupMode + type CleanupResult struct + HistoryEntryIDs []int64 + RowsDeleted int + type Diagnostic interface + Cleanup func(ctx context.Context, req CleanupRequest) (CleanupResult, error) + Description func() string + Detect func(ctx context.Context) ([]Row, error) + Name func() string + type HistoryEntry struct + ActorKeyPrefix string + DeletedAt time.Time + Diagnostic string + ID int64 + RequestID string + RowData json.RawMessage + SourcePK string + SourceTable string + type HistoryListFilter struct + Diagnostic string + Limit int + Offset int + SourceTable string + type OrphanTorrents struct + func NewOrphanTorrents(db *sql.DB, session SessionRemover) *OrphanTorrents + func (o *OrphanTorrents) Cleanup(ctx context.Context, req CleanupRequest) (CleanupResult, error) + func (o *OrphanTorrents) Description() string + func (o *OrphanTorrents) Detect(ctx context.Context) ([]Row, error) + func (o *OrphanTorrents) Name() string + type Registry struct + func New(db *sql.DB, logger *slog.Logger) *Registry + func (r *Registry) DB() *sql.DB + func (r *Registry) DeleteHistoryEntry(ctx context.Context, id int64) error + func (r *Registry) Get(name string) Diagnostic + func (r *Registry) GetHistoryEntry(ctx context.Context, id int64) (*HistoryEntry, error) + func (r *Registry) List() []Diagnostic + func (r *Registry) ListHistory(ctx context.Context, filter HistoryListFilter) ([]HistoryEntry, error) + func (r *Registry) Logger() *slog.Logger + func (r *Registry) PurgeOlderThan(ctx context.Context, retention time.Duration) (int64, error) + func (r *Registry) Register(d Diagnostic) + type Row struct + ID string + SuggestedAction string + Summary string + WhyFlagged string + type SessionRemover interface + LiveHashes func() map[string]struct{}