internal

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package internal contains all the internal implementations of File Tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(err error)

Check reports errors to stdout.

func Cleanup

func Cleanup(params *CleanupParams) error

Cleanup cleans up a directory structure.

func Initialize

func Initialize()

Initialize sets up the standard environment for an application.

func Similar

func Similar(p *SimilarParams)

Similar finds similarly named files in a directory structure.

func StringList

func StringList(flagValue *string) []string

StringList removes all empty and duplicate entries from a comma separated list of strings.

func Unique

func Unique(p *UniqueParams) error

Unique finds all the duplicate files in a directory structure based on the UniqueParams

Types

type CleanupParams

type CleanupParams struct {
	Paths  []string
	DryRun bool
}

CleanupParams is the parameters for cleaning up a directory.

type DuplicateFileReport

type DuplicateFileReport struct {
	Title      string
	Duplicates map[string]*FilesWithSameHash
}

DuplicateFileReport is a report of all the duplicate files.

type FileItem

type FileItem struct {
	Name  string
	Size  int64
	Style string
}

FileItem is a descriptor for a file.

type FileTable

type FileTable struct {
	Title    string
	FileItem []FileItem
}

FileTable is a table of files

type FilesWithSameHash

type FilesWithSameHash struct {
	Names []string
	Size  int64
}

FilesWithSameHash holds a list of files with the same hash code.

type SimilarParams

type SimilarParams struct {
	Paths       []string
	ClearTokens []string
}

SimilarParams are the parameters for finding similarly named files.

type UniqueParams

type UniqueParams struct {
	Paths           []string
	MinSize         int64
	DeletePaths     []string
	DryRun          bool
	ReportFile      string
	Verbose         bool
	Overwrite       bool
	HashFunction    string
	StatusFrequency time.Duration
	CoarseHashing   bool
	EnableFilePprof bool
}

UniqueParams is the parameters for finding duplicate files in a directory structure.

Directories

Path Synopsis
Package metadata extracts important information from a file.
Package metadata extracts important information from a file.

Jump to

Keyboard shortcuts

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