scan

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package scan handles individual directories housing specific assets.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDir    = errors.New("directory to backup is missing")
	ErrBackup = errors.New("directory to save tar backup files is missing")
	ErrNil    = errors.New("parameter cannot be nil")
	ErrTarget = errors.New("unknown target")
)

Functions

func Backup

func Backup(w io.Writer, skip Files, list *[]os.FileInfo, s *Scan, d *directories.Dir) 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 Skip added in v1.11.0

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

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

type Results

type Results struct {
	Count int   // Count the number of results
	Fails int   // Fails are the sum of errors
	Bytes int64 // Bytes is sum total of file sizes.
}

Results of a directory scan.

func (*Results) Calculate

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

Calculate and save the results.

type Scan

type Scan struct {
	Path   string       // Path to scan.
	Delete bool         // Delete any detected orphan files.
	Human  bool         // Human humanizes any byte values.
	IDs    database.IDs // IDs fetched from the database.
}

Scan a directory.

Jump to

Keyboard shortcuts

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