gc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gc cleans up orphaned Docker resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GC

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

GC cleans up orphaned containers, volumes, images, and build dirs.

func New

func New(db *sql.DB, dockerClient docker.Client, interval time.Duration, buildDir string) *GC

New creates a garbage collector with the given interval.

func (*GC) Run

func (g *GC) Run(ctx context.Context)

Run starts the GC loop. Blocks until ctx is cancelled. Recovers from panics to keep the loop alive.

func (*GC) SetSnapshotCleaner

func (g *GC) SetSnapshotCleaner(cleaner SnapshotCleaner, maxPerService int, maxAge time.Duration)

SetSnapshotCleaner configures snapshot retention cleanup. When set, the GC loop will periodically remove snapshots exceeding the per-service count or age limits.

type SnapshotCleaner

type SnapshotCleaner interface {
	CleanExpired(ctx context.Context, maxPerService int, maxAge time.Duration) (int, error)
}

SnapshotCleaner is the interface used by GC to clean expired snapshots. The snapshots.Manager satisfies this interface.

Jump to

Keyboard shortcuts

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