Documentation
¶
Index ¶
Constants ¶
View Source
const ( // HousekeeperTaskType is the name of the task responsible for cleaning // up stale records from the database. HousekeeperTaskType = "common:task:housekeeper" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HousekeeperPayload ¶
type HousekeeperPayload struct {
// Retention provides the retention configuration of objects.
Retention []RetentionConfig `yaml:"retention"`
}
HousekeeperPayload represents the payload of the housekeeper task.
type RetentionConfig ¶
type RetentionConfig struct {
// Name specifies the model name.
Name string `yaml:"name" json:"name"`
// Duration specifies the max duration for which an object will be kept,
// if it hasn't been updated recently.
//
// For example:
//
// UpdatedAt field for an object is set to: Thu May 30 16:00:00 EEST 2024
// Duration of the object is configured to: 4 hours
//
// If the object is not update anymore by the time the housekeeper runs,
// after 20:00:00 this object will be considered as stale and removed
// from the database.
Duration time.Duration `yaml:"duration" json:"duration"`
}
RetentionConfig represents the retention configuration for a given model.
Click to show internal directories.
Click to hide internal directories.