Documentation
¶
Overview ¶
Package retention bounds Mooring's own audit/events table so it can never become the disk-wedge that kills the write plane (plan §16.1). It is read-plane (it only prunes its own rows) and runs precisely when the box is small.
The cardinal invariant: a level=security audit row is NEVER silently dropped. Every security row that is about to be pruned is first appended to a rotated NDJSON archive; if that append fails, the whole pass aborts WITHOUT deleting anything (fail-closed) — losing audit evidence is never acceptable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Interval time.Duration
EventsMaxAge time.Duration
EventsMaxRows int
ArchiveMaxBytes int64
}
Config is the live, SIGHUP-reloadable retention policy (plan §16.1 Tier-1).
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner prunes the events table on a ticker. Construct with New; drive with Run.
func New ¶
New builds a Runner. archiveDir is where the security-row NDJSON archive lives (Mooring's own data dir); cfg is the initial (reloadable) policy.
func (*Runner) Pass ¶
Pass runs one full retention pass over the events table and returns the number of rows pruned. Exported for tests + on-demand invocation.