Documentation
¶
Overview ¶
Package files provides functionality for creating filesystem hierarchies of random files an directories. This is useful for testing that needs to operate on directory trees. Random results are reproducible by reusing the same seed. Random values are not cryptographically secure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Depth is the depth of the directory tree including the root directory. Depth int // Dirs is the number of subdirectories at each depth. Dirs int // Files is the number of files at each depth. Files int // FileSize sets the number of random bytes in each file. FileSize int64 // Where to write display output, such as os.Stdout. Default is nil. Out io.Writer // RandomDirss specifies whether or not to randomize the number of // subdirectoriess from 1 to the value configured by Dirs. RandomDirs bool // RandomFiles specifies whether or not to randomize the number of files // from 1 to the value configured by Files. RandomFiles bool // RandomSize specifies whether or not to randomize the file size from 1 to // the value configured by FileSize. RandomSize bool // Seed sets the seen for the random number generator when set to a // non-zero value. Seed int64 }
func DefaultConfig ¶
func DefaultConfig() Config
Click to show internal directories.
Click to hide internal directories.