prune

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 5 Imported by: 0 modules, 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 (
	Every = time.Hour
	Keep  = 30 * 24 * time.Hour
)
View Source
const Key workflow.Key = "prune:state"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store Store
	Now   func() time.Time
	Log   *slog.Logger
}

type Service

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

Service runs the prune on the wall clock: a timer of the injected clock is a step that a test of the workers counts and advances.

func NewService

func NewService(cfg Config) *Service

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

func (*Service) Wait

func (s *Service) Wait()

type Store

type Store interface {
	Prune(ctx context.Context, before time.Time) (int64, error)
}

type Workflow

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

func New

func New(cfg Config) *Workflow

func (*Workflow) Pending

func (w *Workflow) Pending(context.Context) ([]workflow.Key, error)

func (*Workflow) Step

func (w *Workflow) Step(ctx context.Context, _ workflow.Key) (workflow.Next, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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