Documentation
¶
Overview ¶
Package dupers is the blazing-fast file duplicate checker and filename search.
Package dupers is the blazing-fast file duplicate checker and filename search.
Package dupers is the blazing-fast file duplicate checker and filename search.
Index ¶
- Variables
- func IsArchive(name string) (result bool, mime string, err error)
- func IsExtension(name string) (result bool, mime string)
- func Print(quiet, exact bool, term string, m *database.Matches) string
- type Bucket
- type Config
- func (i *Config) Buckets() []Bucket
- func (c *Config) CheckPaths() (ok bool, checkCnt, bucketCnt int)
- func (c *Config) Clean() string
- func (i *Config) Compares() int
- func (i *Config) OpenRead()
- func (i *Config) OpenWrite()
- func (c *Config) Print() string
- func (i *Config) PrintBuckets() string
- func (c *Config) Remove() string
- func (c *Config) RemoveAll() string
- func (i *Config) SetAllBuckets()
- func (i *Config) SetBuckets(names ...string)
- func (i *Config) SetCompares(name Bucket) int
- func (i *Config) SetTimer()
- func (i *Config) SetToCheck(name string)
- func (c *Config) Status() string
- func (i *Config) Timer() time.Duration
- func (i *Config) ToCheck() string
- func (c *Config) WalkArchiver(name Bucket) error
- func (c *Config) WalkDir(name Bucket) error
- func (c *Config) WalkDirs()
- func (c *Config) WalkSource() error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoBucket = errors.New("a named bucket is required") ErrPathExist = errors.New("path exists in the database bucket") ErrPathNoFound = errors.New("path does not exist") )
var ErrArchiverType = errors.New("archiver type is unsupported")
Functions ¶
func IsArchive ¶
IsArchive returns true if the read named file is compressed using a supported archive format.
func IsExtension ¶
IsExtension returns true if the named file extension matches a supported archive format.
Types ¶
type Config ¶
type Config struct {
Debug bool // spam the feedback sent to stdout
Quiet bool // reduce the feedback sent to stdout
Test bool // internal unit test mode
// contains filtered or unexported fields
}
Config options for duper.
func (*Config) CheckPaths ¶
CheckPaths counts the files in the directory to check and the buckets.
func (*Config) Clean ¶
Clean removes all empty directories from c.Source. Directories containing hidden system directories or files are not considered empty.
func (*Config) Compares ¶
func (i *Config) Compares() int
Compares returns the number of items contained in c.compare.
func (*Config) OpenWrite ¶
func (i *Config) OpenWrite()
OpenWrite opens the Bolt database for reading and writing.
func (*Config) PrintBuckets ¶
func (i *Config) PrintBuckets() string
PrintBuckets returns a list of buckets used by the database.
func (*Config) RemoveAll ¶
RemoveAll removes directories from the source directory that do not contain unique MS-DOS or Windows programs.
func (*Config) SetAllBuckets ¶
func (i *Config) SetAllBuckets()
SetAllBuckets sets all the database backets for use with the dupe or search.
func (*Config) SetBuckets ¶
func (i *Config) SetBuckets(names ...string)
SetBuckets adds the bucket name to a list of buckets.
func (*Config) SetCompares ¶
SetCompares fetches items from the named bucket and sets them to c.compare.
func (*Config) SetToCheck ¶
func (i *Config) SetToCheck(name string)
SetToCheck sets the named string as the directory or file to check.
func (*Config) ToCheck ¶
func (i *Config) ToCheck() string
ToCheck returns the directory or file to check.
func (*Config) WalkArchiver ¶
WalkArchiver walks the bucket directory saving the checksums of new files to the database. Any archived files supported by archiver will also have its content hashed. Archives within archives are currently left unwalked.
func (*Config) WalkDir ¶
WalkDir walks the named bucket directory for any new files and saves their checksums to the bucket.
func (*Config) WalkDirs ¶
func (c *Config) WalkDirs()
WalkDirs walks the named bucket directories for any new files and saves their checksums to the database.
func (*Config) WalkSource ¶
WalkSource walks the source directory or a file to collect its hashed content for future comparison.