Documentation
¶
Index ¶
- func CleanDirectory(dirPath string) error
- func CompareDirectories(dir1, dir2 string) (bool, error)
- func CompareDirectoriesHasher(dir1, dir2 string, h hash.Hash) (bool, error)
- func ExistsAndIsDirectory(path string) (exists, isDir bool, err error)
- func ReadOrPanic(p string) []byte
- func ReplaceDirectory(currentPath, targetPath string) error
- func ReplaceFile(currentPath, targetPath string) error
- func SafeReadFile(filePath string, perm os.FileMode) ([]byte, error)
- func SafeReadYAML(filePath string, targetPointer any, perm os.FileMode) (yamlAvailable bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanDirectory ¶ added in v0.10.0
CleanDirectory removes all files and subdirectories within dirPath, leaving the directory itself intact.
func CompareDirectories ¶ added in v0.10.0
CompareDirectories checks if two directories have the same structure and content. Walks both folders and ensures the contents are identical (compares file hashes).
func CompareDirectoriesHasher ¶ added in v0.10.4
CompareDirectoriesHasher checks if two directories have the same structure and content. Walks both folders and ensures the contents are identical (compares file hashes).
func ExistsAndIsDirectory ¶
func ReadOrPanic ¶
ReadOrPanic reads the entire file at the provided path or panics if it is not possible.
func ReplaceDirectory ¶ added in v0.10.0
ReplaceDirectory atomically replaces the directory at targetPath with the directory at currentPath. It removes any existing directory at currentPath and uses a unique lock file based on targetPath.
func ReplaceFile ¶ added in v0.10.0
ReplaceFile atomically replaces the file at targetPath with the file at currentPath, using a unique lock file based on targetPath.
func SafeReadFile ¶
SafeReadFile reads the file at the provided path into a byte slice.
Types ¶
This section is empty.