Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MultiSelectPrompt = func(string, []string, []string) ([]string, error) { return nil, fmt.Errorf("MultiSelectPrompt not wired: command layer must assign it") }
MultiSelectPrompt asks the user to pick cleanup operations. Wired by the command layer (cmd/compose and cmd/clean inits) so this package never imports presentation code for prompting; tests override it per-case. Defaults fail loudly instead of hanging on stdin.
Functions ¶
func GetDockerDiskUsage ¶
GetDockerDiskUsage returns the raw output of docker system df.
func IsDockerAvailable ¶
func IsDockerAvailable() bool
IsDockerAvailable checks if the docker CLI is present and the daemon responds.
func ParseReclaimedBytes ¶
ParseReclaimedBytes extracts the byte count from docker prune output.
Types ¶
type CleanupTask ¶
type CleanupTask struct {
ID string
Label string
Category string
Execute func(opts SystemCleanOptions) (int64, string, error)
IsAvailable func() bool
}
CleanupTask represents a discrete maintenance task.
type DockerCleanOptions ¶
type DockerCleanOptions struct {
All bool
OlderThan string
BuildCache bool
Volumes bool
DryRun bool
Verbose bool
}
DockerCleanOptions holds configuration options for Docker cleanup.
type ItemResult ¶
type ItemResult struct {
Name string `json:"name"`
Category string `json:"category"`
Status Status `json:"status"`
FreedBytes int64 `json:"freed_bytes"`
Message string `json:"message,omitempty"`
ReclaimText string `json:"reclaim_text,omitempty"`
}
ItemResult records the outcome of a single cleanup operation.
type Report ¶
type Report struct {
Items []ItemResult `json:"items"`
TotalFreedBytes int64 `json:"total_freed_bytes"`
}
Report aggregates multiple cleanup results and renders summary metrics.
func RunDockerCleanup ¶
func RunDockerCleanup(opts DockerCleanOptions) (*Report, error)
RunDockerCleanup performs granular Docker engine pruning.
func RunSystemCleanup ¶
func RunSystemCleanup(opts SystemCleanOptions) (*Report, error)
RunSystemCleanup orchestrates full host maintenance across OS types.
func (*Report) Add ¶
func (r *Report) Add(item ItemResult)
Add appends an item result to the report and updates running totals.
func (*Report) RenderSummaryTable ¶
RenderSummaryTable formats a terminal summary card for all cleanup results.