target

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoredNames added in v1.6.0

func IgnoredNames() []string

IgnoredNames returns OS-managed metadata filenames that scans skip. Returns a copy so callers cannot mutate the underlying policy.

func IsBuiltinID

func IsBuiltinID(id string) bool

func RegisterBuiltin

func RegisterBuiltin(id string, factory BuiltinFactory)

RegisterBuiltin registers a builtin target factory.

Types

type BrewTarget

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

func NewBrewTarget

func NewBrewTarget(cat types.Category) *BrewTarget

func (*BrewTarget) Category

func (s *BrewTarget) Category() types.Category

func (*BrewTarget) Clean

func (s *BrewTarget) Clean(items []types.CleanableItem) (*types.CleanResult, error)

func (*BrewTarget) IsAvailable

func (s *BrewTarget) IsAvailable() bool

func (*BrewTarget) Scan

func (s *BrewTarget) Scan() (*types.ScanResult, error)

type BuiltinCleaner added in v1.3.11

type BuiltinCleaner interface {
	Clean(items []types.CleanableItem) (*types.CleanResult, error)
}

BuiltinCleaner is implemented by targets that have their own cleanup logic (e.g. brew, docker).

type BuiltinFactory

type BuiltinFactory func(cat types.Category, categories []types.Category) Target

BuiltinFactory is a function that creates a Target from a category and optional categories list.

type DockerTarget

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

func NewDockerTarget

func NewDockerTarget(cat types.Category) *DockerTarget

func (*DockerTarget) Category

func (s *DockerTarget) Category() types.Category

func (*DockerTarget) Clean

func (s *DockerTarget) Clean(items []types.CleanableItem) (*types.CleanResult, error)

func (*DockerTarget) IsAvailable

func (s *DockerTarget) IsAvailable() bool

func (*DockerTarget) Scan

func (s *DockerTarget) Scan() (*types.ScanResult, error)

type OldDownloadTarget

type OldDownloadTarget struct {
	*PathTarget
	// contains filtered or unexported fields
}

OldDownloadTarget scans for old files in the Downloads folder.

func NewOldDownloadTarget

func NewOldDownloadTarget(cat types.Category, daysOld int) *OldDownloadTarget

func (*OldDownloadTarget) Clean

Clean moves the selected items to trash.

func (*OldDownloadTarget) Scan

func (s *OldDownloadTarget) Scan() (*types.ScanResult, error)

Scan returns files older than the configured days' threshold.

type PathTarget

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

func NewPathTarget

func NewPathTarget(cat types.Category) *PathTarget

func (*PathTarget) Category

func (s *PathTarget) Category() types.Category

func (*PathTarget) IsAvailable

func (s *PathTarget) IsAvailable() bool

func (*PathTarget) Scan

func (s *PathTarget) Scan() (*types.ScanResult, error)

type ProjectCacheTarget added in v1.4.0

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

ProjectCacheTarget scans $HOME recursively for stale build caches inside project directories, using marker-file validation to avoid false positives.

func NewProjectCacheTarget added in v1.4.0

func NewProjectCacheTarget(cat types.Category) *ProjectCacheTarget

func (*ProjectCacheTarget) Category added in v1.4.0

func (t *ProjectCacheTarget) Category() types.Category

func (*ProjectCacheTarget) Clean added in v1.4.0

func (*ProjectCacheTarget) IsAvailable added in v1.4.0

func (t *ProjectCacheTarget) IsAvailable() bool

func (*ProjectCacheTarget) Scan added in v1.4.0

func (t *ProjectCacheTarget) Scan() (*types.ScanResult, error)

type Registry

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

func DefaultRegistry

func DefaultRegistry(cfg *types.Config) (*Registry, error)

func NewRegistry

func NewRegistry() *Registry

func (*Registry) All

func (r *Registry) All() []Target

func (*Registry) Available

func (r *Registry) Available() []Target

func (*Registry) Get

func (r *Registry) Get(id string) (Target, bool)

func (*Registry) Register

func (r *Registry) Register(s Target)

type SystemCacheTarget

type SystemCacheTarget struct {
	*PathTarget
	// contains filtered or unexported fields
}

SystemCacheTarget scans system cache excluding paths defined in other categories

func NewSystemCacheTarget

func NewSystemCacheTarget(cat types.Category, allCategories []types.Category) *SystemCacheTarget

func (*SystemCacheTarget) Scan

func (s *SystemCacheTarget) Scan() (*types.ScanResult, error)

type Target

type Target interface {
	Scan() (*types.ScanResult, error)
	Category() types.Category
	IsAvailable() bool
}

Jump to

Keyboard shortcuts

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