Documentation ¶
Index ¶
- func ArchiveDir(fs billy.Filesystem, srcPath, destTgzPath string) error
- func CompareDirs(fs billy.Filesystem, leftDirpath, rightDirpath string, ...) error
- func CompareTgzs(fs billy.Filesystem, leftTgzPath string, rightTgzPath string) (bool, error)
- func CopyDir(fs billy.Filesystem, srcDir string, dstDir string) error
- func CopyFile(fs billy.Filesystem, srcPath string, dstPath string) error
- func CreateFileAndDirs(fs billy.Filesystem, path string) (billy.File, error)
- func GetAbsPath(fs billy.Filesystem, path string) string
- func GetChartArchive(fs billy.Filesystem, url string, path string) error
- func GetFilesystem(path string) billy.Filesystem
- func GetRelativePath(fs billy.Filesystem, abspath string) (string, error)
- func GetRootPath(path string) (string, error)
- func IsEmptyDir(fs billy.Filesystem, path string) (bool, error)
- func MakeSubdirectoryRoot(fs billy.Filesystem, path, subdirectory string) error
- func MovePath(path string, fromDir string, toDir string) (string, error)
- func PathExists(fs billy.Filesystem, path string) (bool, error)
- func PruneEmptyDirsInPath(fs billy.Filesystem, path string) error
- func RemoveAll(fs billy.Filesystem, path string) error
- func UnarchiveTgz(fs billy.Filesystem, tgzPath, tgzSubdirectory, destPath string, overwrite bool) error
- func UpdatePermissions(fs billy.Filesystem, path string, mode int64) error
- func WalkDir(fs billy.Filesystem, dirPath string, doFunc RelativePathFunc) error
- type RelativePathFunc
- type RelativePathPairFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveDir ¶ added in v0.2.3
ArchiveDir archives a directory or a file into a tgz file and put it at destTgzPath which should end with .tgz
func CompareDirs ¶
func CompareDirs(fs billy.Filesystem, leftDirpath, rightDirpath string, leftOnlyFunc, rightOnlyFunc RelativePathFunc, bothFunc RelativePathPairFunc) error
CompareDirs compares the contents of the directory at fromDirpath against that of the directory at toDirpath within a given filesystem It execute leftOnlyFunc on paths that only exist on the leftDirpath and rightOnlyFunc on paths that only exist on rightDirpath It executes bothFunc on paths that exist on both the left and the right. Order will be preserved in the function arguments
func CompareTgzs ¶ added in v0.3.0
CompareTgzs checks to see if the file contents of the archive found at leftTgzPath matches that of the archive found at rightTgzPath It does this by comparing the sha256sum of the file contents, ignoring any other information (e.g. file modes, timestamps, etc.)
func CopyFile ¶
CopyFile copies a file from srcPath to dstPath within a filesystem. It creates any relevant directories along the way
func CreateFileAndDirs ¶
CreateFileAndDirs creates a file on the filesystem and all relevant directories along the way if they do not exist. The file that is created must be closed by the caller
func GetAbsPath ¶
GetAbsPath returns the absolute path given the relative path within a filesystem
func GetChartArchive ¶
GetChartArchive gets a chart tgz file from a url and drops it into the path specified on the filesystem
func GetFilesystem ¶
func GetFilesystem(path string) billy.Filesystem
GetFilesystem returns a filesystem rooted at the provided path
func GetRelativePath ¶
GetRelativePath returns the relative path given the absolute path within a filesystem
func GetRootPath ¶
GetRootPath returns the first directory in a given path
func IsEmptyDir ¶
IsEmptyDir returns whether the path provided is an empty directory or an error
func MakeSubdirectoryRoot ¶
MakeSubdirectoryRoot makes a particular subdirectory of a path its main directory
func MovePath ¶
MovePath takes a path that is contained within fromDir and returns the same path contained within toDir
func PathExists ¶
PathExists checks if a path exists on the filesystem or returns an error
func PruneEmptyDirsInPath ¶
PruneEmptyDirsInPath removes all empty directories located within the path
func UnarchiveTgz ¶
func UnarchiveTgz(fs billy.Filesystem, tgzPath, tgzSubdirectory, destPath string, overwrite bool) error
UnarchiveTgz attempts to unarchive the tgz file found at tgzPath in the filesystem
func UpdatePermissions ¶
UpdatePermissions updates the permissions for a given path to the mode provided
func WalkDir ¶
func WalkDir(fs billy.Filesystem, dirPath string, doFunc RelativePathFunc) error
WalkDir walks through a directory given by dirPath rooted in the filesystem and performs doFunc at the path The path on each call will be relative to the filesystem provided.
Types ¶
type RelativePathFunc ¶
RelativePathFunc is a function that is applied on a relative path within the given filesystem
type RelativePathPairFunc ¶
RelativePathPairFunc is a function that is applied on a pair of relative paths in a filesystem