retention

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Default          time.Duration
	ByClassification map[model.EvidenceClass]time.Duration
	BySensitivity    map[model.Sensitivity]time.Duration
}

Policy applies a default maximum retention and optional privacy-reducing overrides. Overrides must be positive and no longer than Default.

type RunReport

type RunReport struct {
	Result storage.RetentionResult
	Err    error
}

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

func (*Scheduler) Done

func (scheduler *Scheduler) Done() <-chan struct{}

func (*Scheduler) Reports

func (scheduler *Scheduler) Reports() <-chan RunReport

func (*Scheduler) Stop

func (scheduler *Scheduler) Stop(ctx context.Context) error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(database *storage.DB, eventRetention time.Duration, requiredProjections []string) (*Service, error)

func NewWithPolicy

func NewWithPolicy(database *storage.DB, policy Policy, requiredProjections []string) (*Service, error)

func (*Service) RunOnce

func (service *Service) RunOnce(ctx context.Context) (storage.RetentionResult, error)

func (*Service) Start

func (service *Service) Start(parent context.Context, interval time.Duration) (*Scheduler, error)

Start launches one immediate retention pass followed by interval-based passes. Stop or cancellation waits for an in-flight transaction to finish or observe cancellation; there are never overlapping passes.

Jump to

Keyboard shortcuts

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