clean

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package clean executes a selection of items: hard-delete caches, trash user data, or run a tool command. Refuses to touch Keep items.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trash added in v0.5.0

func Trash(path string) error

Trash moves a single path to the Trash (recoverable). Honors DSCAN_TRASH_DIR.

Types

type Action

type Action struct {
	Item   rules.Item
	Method rules.CleanMethod
	Err    error
}

Action records what was (or would be) done to one item.

type Options

type Options struct {
	DryRun bool
}

Options control a clean run.

type Result

type Result struct {
	Actions    []Action
	Skipped    []rules.Item
	FreedBytes int64
}

Result summarizes a run.

func Run

func Run(items []rules.Item, opt Options) Result

Run cleans the given items per their effective method.

func (Result) FreedBytesOrPlanned

func (r Result) FreedBytesOrPlanned(dry bool) int64

FreedBytesOrPlanned returns FreedBytes, or for a dry run the bytes that would be freed by the recorded actions.

Jump to

Keyboard shortcuts

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