retention

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupResult

type CleanupResult struct {
	FilesRemoved int
	BytesFreed   int64
	Errors       []error
}

func CleanDirectory

func CleanDirectory(dir string, policy Policy) CleanupResult

CleanDirectory removes files older than policy.MaxAge from dir.

func EnforceSize

func EnforceSize(dir string, policy Policy) CleanupResult

EnforceSize removes oldest files until total size is under policy.MaxSizeMB.

type Policy

type Policy struct {
	MaxAge    time.Duration `json:"max_age"`
	MaxSizeMB int64         `json:"max_size_mb"`
}

func DefaultPolicy

func DefaultPolicy() Policy

Jump to

Keyboard shortcuts

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