Versions in this module Expand all Collapse all v0 v0.1.0 Jul 12, 2023 Changes in this version + var LowerCaseChars string + var ValidChars string + func CommitDirs(tree *Dir, root string) int + func CommitNewDefaultRandomTree(t *testing.T) (string, *Dir, DirStats) + func CommitNewRandomTree(t *testing.T, altRoot string, o TreeOptions, m Mixes) (string, *Dir, DirStats) + func CommitZonedFilesMixed(rnd1 *xrand.Xrand, rnd2 *xrand.Xrand, files []*File, z Zones, m Mixes, ...) (DirStats, []*File) + func DirStatsTable() *format.Table + func NewCloneFileOperation(sbase, dbase string) func(*File, *File) + func NewDirMakerFactory(base string) func(*Dir) + func NewFileFromStorageFactory(base string) func(Entry) *File + func NewLinkFileOperation(sbase, dbase string) func(*File, *File) + func NewRandomFileFactory(rnd *xrand.Xrand, base string, sizeFactory func() int) func(*File) + func NewRandomNameFactory(rnd *xrand.Xrand, sizeFactory func() int, charSet string) func() string + func ShuffleFiles(rnd *xrand.Xrand, f []*File) + func TempDir(t *testing.T, altName string) string + type Dir struct + Dirs []*Dir + Files []*File + func NewDirFromStorage(base string) *Dir + func NewDirFromStorageFiltered(base string, fileFilter func(e Entry) bool) *Dir + func NewRandomTree(rnd *xrand.Xrand, o TreeOptions) *Dir + func NewRandomTree2(rnd *xrand.Xrand, o TreeOptions) (*Dir, func() string) + func (d *Dir) AllDirsMap() map[string]*Dir + func (d *Dir) AllDirsSlice() []*Dir + func (d *Dir) AllFilesMap() map[string]*File + func (d *Dir) AllFilesSlice() []*File + func (d *Dir) Compare(o *Dir) bool + func (d *Dir) Dump(outFile string) + func (d *Dir) EachDir(cb func(*Dir)) + func (d *Dir) EachDirRecursive(cb func(*Dir)) (count int) + func (d *Dir) EachFile(cb func(*File)) + func (d *Dir) EachFileRecursive(cb func(*File)) + func (d *Dir) EachRecursive(fcb func(*File), dcb func(*Dir)) + func (d *Dir) RemoveFiles(files []*File) + func (d *Dir) Sort() + type DirFactory func(parent *Dir, depth int) *Dir + func NewDirFactory(entryFactory EntryFactory, filesFactory FilesFactory, dirsFactory DirsFactory) DirFactory + type DirStats struct + ClonedFiles int + LinkedFiles int + TotalFiles int + UniqueHashes int + func CommitFilesMixed(rnd *xrand.Xrand, files []*File, m Mixes, root string) DirStats + func CommitMixed(rnd *xrand.Xrand, tree *Dir, m Mixes, root string) DirStats + func (ds *DirStats) AppendToTable(t *format.Table) *format.Table + func (ds *DirStats) Merge(o DirStats) + func (ds DirStats) String() string + type DirsFactory func(parent *Dir, depth int) []*Dir + func NewDirsFactory(maxDepth int, countFactory func() int) (DirsFactory, func(DirFactory)) + func NullDirsFactory() DirsFactory + type Entry struct + Name string + Parent *Dir + func (e *Entry) Path() string + func (e *Entry) PathFrom(base string) string + type EntryFactory func(parent *Dir) Entry + func NewEntryFactory(nameFactory func() string) EntryFactory + func NullEntryFactory() EntryFactory + type File struct + Hash []byte + func (f *File) String() string + type FileFactory func(parent *Dir) *File + func NewFileFactory(entryFactory EntryFactory) FileFactory + type FilesFactory func(parent *Dir) []*File + func NewFilesFactory(fileFactory FileFactory, countFactory func() int) FilesFactory + func NullFilesFactory() FilesFactory + type MinMax struct + Max int + Min int + type Mixes struct + Cloned int + Created int + Linked int + MaxSize int + func DefaultMixes() Mixes + type TreeOptions struct + CharCount MinMax + CharSet string + Depth int + DirCount MinMax + FileCount MinMax + func DefaultTreeOptions() TreeOptions + func FlatTreeOptions(minFiles, maxFiles int) TreeOptions + type Zones struct + NoChange int + Reseed int + Shuffle int + func DefaultZones() Zones