config

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppDir

func AppDir() string

AppDir returns the root application data directory.

func Dir

func Dir() string

Dir returns the directory where config and other app data live.

func Path

func Path() string

Path returns the full path to config.json.

func Save

func Save(cfg *Config) error

Save writes the config to disk.

Types

type Config

type Config struct {
	EnabledCategories  map[string]bool   `json:"enabled_categories"`
	ActivePreset       string            `json:"active_preset"`
	OldInstallerMonths int               `json:"old_installer_months"`
	LargeFileMinSizeMB int               `json:"large_file_min_size_mb"`
	LargeFileMonths    int               `json:"large_file_months"`
	Exclusions         []string          `json:"exclusions"`
	AutoRiskOverrides  map[string]string `json:"auto_risk_overrides"`
	// QuarantineEnabled controls whether cleanups move files to quarantine (true, default)
	// or permanently delete them without recovery (false).
	QuarantineEnabled bool `json:"quarantine_enabled"`
	// QuarantineAutoCleanupDays: 0 = disabled. When > 0, a Windows scheduled task runs
	// `broominal quarantine-cleanup --force --max-age-days N` daily at 03:00.
	QuarantineAutoCleanupDays int    `json:"quarantine_auto_cleanup_days,omitempty"`
	Language                  string `json:"language"`
}

Config holds user-configurable cleanup rules.

func Default

func Default() *Config

Default returns the built-in default configuration.

func Load

func Load() (*Config, error)

Load reads the config from disk or returns defaults if missing.

func (*Config) ApplyPreset

func (c *Config) ApplyPreset(p Preset)

func (*Config) IsCategoryEnabled

func (c *Config) IsCategoryEnabled(name string) bool

IsCategoryEnabled reports whether a category is enabled.

func (*Config) IsExcluded

func (c *Config) IsExcluded(path string) bool

IsExcluded reports whether a path matches any exclusion rule.

func (*Config) RiskOverrideFor

func (c *Config) RiskOverrideFor(path string) string

RiskOverrideFor returns an override risk for a path, or empty string.

type Preset

type Preset string
const (
	PresetQuick    Preset = "quick"
	PresetStandard Preset = "standard"
	PresetDeep     Preset = "deep"
)

Jump to

Keyboard shortcuts

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