Documentation ¶
Index ¶
- func Contains(arr []string, val string) bool
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func DirectoryExists(directory string) bool
- func ExpandPath(pathToExpand string) string
- func FileExists(file string) bool
- func GetChildDirectories(path string) ([]string, error)
- func GetFileLines(path string) ([]string, error)
- func NewID() string
- func RemoveDuplicates(elements []string) []string
- func Reverse(elements []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func DirectoryExists ¶
DirectoryExists Returns true if the given path is a directory, and it exists.
func ExpandPath ¶
ExpandPath Expands the given path to an absolute directory
func FileExists ¶
FileExists Returns true if the given path is a file, and it exists.
func GetChildDirectories ¶
GetChildDirectories Gets child directories in the given directory
func GetFileLines ¶
GetFileLines Get all the lines from a file
func NewID ¶
func NewID() string
NewID generates a new identifier for use where random identifiers with low collision probability are required.
With the parameters in this package, the generated identifier will provide ~129 bits of entropy encoded with base36. Leading padding is added if the string is less 25 bytes. We do not intend to maintain this interface, so identifiers should be treated opaquely.
func RemoveDuplicates ¶
RemoveDuplicates Remove duplicate items from an array.
Types ¶
This section is empty.