Documentation
¶
Index ¶
- Constants
- Variables
- func AdjustCommonPrefix(prefix string, s string) string
- func GetCommonPrefix(s1 string, s2 string) string
- func GetFileCount(sourceDir string, searchRoot string, blackList []string, whiteList []string) int64
- func GetFileSize(filePath string) (int64, error)
- func GetMaxPathPrefixLen(repo map[string]FileRepoEntry) int
- func GetMaxTextLen(repo map[string]FileRepoEntry) int
- func GetMd5(filePath string) (string, error)
- func SearchForDuplicates(searchRoot string, blackList []string, whiteList []string, fileRepo *FileRepo, ...)
- func TraversDir(dir string, blackList []string, whiteList []string, ...)
- type FileRepo
- func (f *FileRepo) CheckForDuplicateAndAddInCase(md5Str string, fileName string)
- func (f *FileRepo) GetEntry(md5Str string) (FileRepoEntry, bool)
- func (f *FileRepo) HasDuplicates() bool
- func (f *FileRepo) HasEntry(md5Str string) bool
- func (f *FileRepo) InitFromSource(sourceDir string, blackList []string, whiteList []string, noProgress bool)
- func (f *FileRepo) Repo() map[string]FileRepoEntry
- func (f *FileRepo) SetEntry(md5Str string, fileName string)
- func (f *FileRepo) Size() int
- type FileRepoEntry
- type TraversResponse
Constants ¶
View Source
const MEGA_BYTE = 1024 * 1024
Variables ¶
View Source
var FileSizeThresholdInMB int64
View Source
var MaxGoRoutines int32
Functions ¶
func AdjustCommonPrefix ¶ added in v0.4.0
func GetCommonPrefix ¶ added in v0.4.0
func GetFileCount ¶
func GetFileSize ¶ added in v0.4.0
func GetMaxPathPrefixLen ¶ added in v0.4.0
func GetMaxPathPrefixLen(repo map[string]FileRepoEntry) int
func GetMaxTextLen ¶ added in v0.4.0
func GetMaxTextLen(repo map[string]FileRepoEntry) int
func SearchForDuplicates ¶
func TraversDir ¶
Types ¶
type FileRepo ¶
type FileRepo struct {
// contains filtered or unexported fields
}
func NewFileRepo ¶
func NewFileRepo() *FileRepo
func (*FileRepo) CheckForDuplicateAndAddInCase ¶
func (*FileRepo) HasDuplicates ¶
func (*FileRepo) InitFromSource ¶
func (*FileRepo) Repo ¶
func (f *FileRepo) Repo() map[string]FileRepoEntry
type FileRepoEntry ¶
type FileRepoEntry struct { SourceFile string `json:"sourceFile,omitempty"` Duplicates []string `json:"duplicates,omitempty"` }
func NewFileRepoEntry ¶
func NewFileRepoEntry(f string) FileRepoEntry
type TraversResponse ¶
type TraversResponse struct {
// contains filtered or unexported fields
}
func ErrorTraversResponse ¶
func ErrorTraversResponse(err error) TraversResponse
func FoundTraversResponse ¶
func FoundTraversResponse(file string, md5 string) TraversResponse
Click to show internal directories.
Click to hide internal directories.