retentionsvc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 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

Index

Constants

View Source
const DailyCronSchedule = "CRON_TZ=UTC 0 0 * * *"

DailyCronSchedule is the system-owned retention maintenance cadence.

Variables

This section is empty.

Functions

func NextRunAt

func NextRunAt(now time.Time) time.Time

NextRunAt returns the next platform-owned daily retention boundary.

func PolicyFromSettings

func PolicyFromSettings(raw []byte) (model.OrganizationRetentionPolicy, error)

func ValidatePolicy

func ValidatePolicy(policy model.OrganizationRetentionPolicy) error

Types

type MaintenanceExecution

type MaintenanceExecution struct {
	SourceJobID int64
	Attempt     int
	StartedAt   time.Time
}

MaintenanceExecution identifies one private worker job attempt. SourceJobID exists only to correlate retries and is never part of tenant-safe models.

type Result

type Result struct {
	WishlistRegistrations int64
	AbuseControlBuckets   int64
	QueryExecutions       int64
	ReplayCheckpoints     int64
	PipelineRuns          int64
	Events                int64
	SkippedOrgs           []slug.Slug
}

type Service

type Service interface {
	PruneExpiredCustomerData(context.Context, MaintenanceExecution) (Result, error)
	ListMaintenanceRuns(context.Context, slug.Slug) ([]model.OrganizationRetentionRun, error)
}

func New

func New(
	txm postgres.TransactionManager,
	repo retention.Repository,
	wishlistRepo wishlistRetentionRepository,
	clk clock.Clock,
) Service

Jump to

Keyboard shortcuts

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