Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCConfig ¶
type GCConfig struct {
// CheckInterval is how often to run the GC sweep (default: 1h)
CheckInterval time.Duration
// RetentionDays is how many days to keep artifacts regardless of count (default: 30)
RetentionDays int
// RetentionCount is how many recent artifacts per app to keep regardless of age (default: 20)
RetentionCount int
}
GCConfig holds configuration for artifact garbage collection.
func DefaultGCConfig ¶
func DefaultGCConfig() GCConfig
DefaultGCConfig returns the default GC configuration.
type GCController ¶
type GCController struct {
Log *slog.Logger
EAC *entityserver_v1alpha.EntityAccessClient
Config GCConfig
// contains filtered or unexported fields
}
GCController periodically applies retention policies to artifacts, transitioning old artifacts to "archived" status.
func (*GCController) RunGC ¶
func (c *GCController) RunGC(ctx context.Context) (*GCResult, error)
RunGC applies the retention policy to all artifacts.
func (*GCController) Start ¶
func (c *GCController) Start(ctx context.Context)
Start begins the periodic GC process.
type GCResult ¶
type GCResult struct {
// ArchivedArtifacts contains IDs of artifacts transitioned to archived
ArchivedArtifacts []entity.Id
// FailedArtifacts contains IDs and errors for artifacts that failed to update
FailedArtifacts map[entity.Id]error
// TotalArtifacts is the total number of artifacts evaluated
TotalArtifacts int
// RetainedArtifacts is the number of artifacts kept active
RetainedArtifacts int
}
GCResult contains information about artifacts processed during GC.
Click to show internal directories.
Click to hide internal directories.