scan

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStructNil = errors.New("structure cannot be nil")
	ErrPathEmpty = errors.New("path cannot be empty")
	ErrTarget    = errors.New("unknown target")
)

Functions

func Backup

func Backup(s *Scan, d *directories.Dir, ignore Files, list []os.FileInfo) error

Backup is used by scanPath to backup matched orphans.

Types

type Files

type Files map[string]struct{}

Files are unique UUID values used by the database and filenames.

func IgnoreList

func IgnoreList(path string, d *directories.Dir) Files

IgnoreList is used by scanPath to filter files that should not be erased.

type Results

type Results struct {
	Count int   // Results handled
	Fails int   // Results that failed
	Bytes int64 // bytes counted
}

func (*Results) Calculate

func (sum *Results) Calculate(s Scan, d *directories.Dir) error

type Scan

type Scan struct {
	Path   string       // directory to scan
	Delete bool         // delete any detected orphan files
	Human  bool         // humanise values shown by print output
	M      database.IDs // UUID values fetched from the database
}

Jump to

Keyboard shortcuts

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