retention

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: AGPL-3.0 Imports: 1 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

Overview

Package retention holds the pure time-window math for the retention sweep (sweep in internal/cleanup, SQL in internal/repository) — unit-testable without a DB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCutoff

func DeleteCutoff(now time.Time, graceDays int) time.Time

DeleteCutoff returns the cutoff before which an archived doc is hard-deleted (archived earlier = past the reversible grace window).

func ExpiryCutoff

func ExpiryCutoff(now time.Time, thresholdDays, multiplier int) time.Time

ExpiryCutoff returns the cutoff before which a section counts as expired: a doc is an archive candidate when even its freshest section was verified before it. Window = multiplier × the doc_type's staleness threshold (days).

func WindowSafe

func WindowSafe(multiplier, graceDays int) bool

WindowSafe reports whether the retention window params are safe. A non-positive multiplier or grace collapses the cutoffs to "now", archiving then hard-deleting live docs wholesale — the sweep refuses when false. Defensive last line (audit #4).

Types

This section is empty.

Jump to

Keyboard shortcuts

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