artifactgc

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobTypeArtifactContainerGC               = "gitfox:cleanup:artifact-container-garbage-collector"
	JobMaxDurationDArtifactContainerGC       = time.Minute * 15
	JobDefaultArtifactContainerRetentionTime = 0
)
View Source
const (
	JobTypeArtifactHardRemove         = "gitfox:cleanup:artifact-soft-remove"
	JobMaxDurationDArtifactSoftRemove = time.Minute * 5
)

Variables

Functions

func NewContainerJob

func NewContainerJob(svc *Service) *containerJob

func NewSoftRemoveJob

func NewSoftRemoveJob(svc *Service) *softRemoveJob

Types

type Input

type Input struct {
	JobUID        string        `json:"-"`
	Kind          Kind          `json:"-"`
	RetentionTime time.Duration `json:"retention_time"`
}

type Kind

type Kind string
var (
	KindContainer  Kind = "container"
	KindSoftRemove Kind = "soft-remove"
)

type Service

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

func NewService

func NewService(
	tx dbtx.Transactor,
	artStore store.ArtifactStore,
	fileStore storage.ContentStorage,
	settings *settings.Service,
	scheduler *job.Scheduler,
	sseStreamer sse.Streamer,
) *Service

func ProvideArtifactSweepSvc

func ProvideArtifactSweepSvc(
	tx dbtx.Transactor,
	artStore store.ArtifactStore,
	fileStore storage.ContentStorage,
	settings *settings.Service,
	scheduler *job.Scheduler,
	executor *job.Executor,
	sseStreamer sse.Streamer,
) (*Service, error)

func (*Service) GarbageCollectContainer

func (s *Service) GarbageCollectContainer(ctx context.Context, retentionTime time.Duration) (*types.ArtifactGarbageReportRes, error)

func (*Service) GarbageCollectSoftRemove

func (s *Service) GarbageCollectSoftRemove(ctx context.Context, retentionTime time.Duration) (*types.ArtifactGarbageReportRes, error)

func (*Service) StatisticContainer

func (s *Service) StatisticContainer(ctx context.Context, retentionTime time.Duration) (*types.ArtifactStatisticReport, error)

func (*Service) StatisticExcludeContainer

func (s *Service) StatisticExcludeContainer(ctx context.Context, retentionTime time.Duration) (*types.ArtifactStatisticReport, error)

StatisticExcludeContainer returns:

  • An array of all soft-removed assets, without container format.
  • An array of capacity usage for each version, excluding container format.

func (*Service) Trigger

func (s *Service) Trigger(ctx context.Context, input *Input) error

Jump to

Keyboard shortcuts

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