Documentation
¶
Overview ¶
Package retention provides lifecycle management for periodic retention work.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPeriodicWorkerCallbackRequired reports a missing retention callback. ErrPeriodicWorkerCallbackRequired = errors.New("periodic retention worker callback is required") // ErrPeriodicWorkerContextRequired reports a nil start context. ErrPeriodicWorkerContextRequired = errors.New("periodic retention worker context is required") // ErrPeriodicWorkerInvalidInterval reports a non-positive sweep cadence. ErrPeriodicWorkerInvalidInterval = errors.New("periodic retention worker interval must be greater than zero") // ErrPeriodicWorkerAlreadyStarted reports an attempt to start an active worker. ErrPeriodicWorkerAlreadyStarted = errors.New("periodic retention worker is already started") )
Functions ¶
This section is empty.
Types ¶
type PeriodicWorker ¶
type PeriodicWorker struct {
// contains filtered or unexported fields
}
PeriodicWorker runs one retention callback at a fixed interval and joins it on shutdown.
func NewPeriodicWorker ¶
func NewPeriodicWorker( label string, sweep func(context.Context) error, interval time.Duration, onError func(error), ) *PeriodicWorker
NewPeriodicWorker builds a joined periodic worker for one retention callback.
Click to show internal directories.
Click to hide internal directories.