pruner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package pruner periodically deletes captured events past their retention window so the store does not grow without bound.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// RetentionAge is how long received events are kept. Zero disables pruning.
	RetentionAge time.Duration
	// FailedRetentionAge keeps rejected and dead-lettered events longer.
	FailedRetentionAge time.Duration
	// Interval is how often the pruner runs.
	Interval time.Duration
}

Options configures retention.

type Pruner

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

Pruner deletes aged events on a schedule.

func New

func New(store storage.Store, logger *slog.Logger, opts Options) *Pruner

New builds a pruner.

func (*Pruner) Enabled

func (p *Pruner) Enabled() bool

Enabled reports whether retention is configured.

func (*Pruner) Run

func (p *Pruner) Run(ctx context.Context) error

Run prunes on Interval until the context is cancelled. It returns immediately when retention is disabled.

Jump to

Keyboard shortcuts

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