artifact

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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.

func (*GCController) Stop

func (c *GCController) Stop()

Stop gracefully stops the controller.

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.

Jump to

Keyboard shortcuts

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