Documentation
¶
Overview ¶
Package datalifecycle manages cr's durable local data retention.
Index ¶
Constants ¶
View Source
const ( // LiveRetention is the default retention window for live review runs. LiveRetention = 90 * 24 * time.Hour // DryRunRetention is the default retention window for dry-run review runs. DryRunRetention = 7 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Layout statepaths.Layout
Store Store
Now func() time.Time
RemoveAll RemoveAllFunc
}
Options contains lifecycle operation dependencies.
type OrphanItem ¶
OrphanItem describes one unreferenced artifact directory.
type PruneOptions ¶
PruneOptions selects runs to prune.
type PruneResult ¶
type PruneResult struct {
DryRun bool
SelectedRuns []RunItem
DeletedRuns []RunItem
OrphansRemoved []OrphanItem
Warnings []string
}
PruneResult summarizes one prune operation.
func Prune ¶
func Prune(ctx context.Context, opts Options, prune PruneOptions) (PruneResult, error)
Prune deletes selected ledger rows first, then best-effort artifact dirs.
type PurgeResult ¶
PurgeResult summarizes a whole data-root purge.
func Purge ¶
func Purge(layout statepaths.Layout, dryRun bool, yes bool, removeAll RemoveAllFunc) (PurgeResult, error)
Purge removes the whole data root without opening the ledger database.
type RemoveAllFunc ¶
RemoveAllFunc removes a path recursively.
type RunItem ¶
type RunItem struct {
RunID string
PostMode ledger.PostMode
StartedAt time.Time
ArtifactPath string
}
RunItem describes one selected or deleted ledger run.
type Stats ¶
type Stats struct {
DataRoot string
LedgerPath string
RunsRoot string
RunCount int
LiveRuns int
DryRunRuns int
OutcomeCounts map[ledger.Outcome]int
OldestStarted *time.Time
NewestStarted *time.Time
ArtifactBytes int64
OrphanCount int
OrphanBytes int64
}
Stats summarizes local durable data.
Click to show internal directories.
Click to hide internal directories.