Documentation ¶
Index ¶
- Variables
- func AllFiles(fs afero.Fs, dir string) ([]string, error)
- func Chmod(t *testing.T, fs afero.Fs, path string, perm os.FileMode)
- func Chown(from os.FileInfo, toName string, fs afero.Fs) error
- func CopyDir(fs afero.Fs, name string, info os.FileInfo) error
- func CopyFile(fs afero.Fs, name string, info os.FileInfo, sourceFile afero.File) error
- func CopySymlink(source, target afero.Fs, name string, info os.FileInfo, ...) error
- func CountFiles(t *testing.T, fs afero.Fs, path string, expectedFilesAndDirs int)
- func CreateFile(t *testing.T, fs afero.Fs, path, content string)
- func CreateMemDir(path string, perm os.FileMode) os.FileInfo
- func CreateMemFile(path, content string, perm os.FileMode) afero.File
- func CreateSymlink(t *testing.T, fs afero.Fs, oldpath, newpath string)
- func DirContains(parent, subdir string) (bool, error)
- func EqualMode(a, b os.FileMode) bool
- func EqualOwner(a os.FileInfo, uid, gid int) bool
- func Exists(fs afero.Fs, path string) (bool, error)
- func FileMustContainText(t *testing.T, fs afero.Fs, path, content string)
- func Gid(from os.FileInfo) int
- func IgnorableChownError(err error) error
- func IgnorableChtimesError(err error) error
- func IsHidden(name string, hiddenPaths []string) (bool, error)
- func IsInHiddenPath(name, hiddenDir string) (relPath string, inHiddenPath bool, err error)
- func IsParentOfHiddenDir(name string, hiddenPaths []string) (bool, error)
- func IterateDirTree(name string, visitor func(string) error) error
- func LExists(fs afero.Fs, path string) (bool, error)
- func LchownIfPossible(fs afero.Fs, name string, uid, gid int) error
- func LstatIfPossible(fs afero.Fs, path string) (os.FileInfo, bool, error)
- func LstaterIfPossible(fs afero.Fs) (afero.Lstater, bool)
- func Mkdir(t *testing.T, fs afero.Fs, path string, perm os.FileMode) error
- func MkdirAll(t *testing.T, fs afero.Fs, path string, perm os.FileMode)
- func ModeMustBeEqual(t *testing.T, a, b os.FileMode)
- func MustExist(t *testing.T, fs afero.Fs, path string)
- func MustLExist(t *testing.T, fs afero.Fs, path string)
- func MustNotExist(t *testing.T, fs afero.Fs, path string)
- func MustNotLExist(t *testing.T, fs afero.Fs, path string)
- func OpenFile(t *testing.T, fs afero.Fs, path, content string, perm os.FileMode)
- func RemoveAll(t *testing.T, fs afero.Fs, path string)
- func RemoveFile(t *testing.T, fs afero.Fs, path string)
- func RestoreFile(name string, backupFi os.FileInfo, base, backup afero.Fs) error
- func RestoreSymlink(name string, backupFi os.FileInfo, base, backup afero.Fs, ...) error
- func SymlinkMustExist(t *testing.T, fs afero.Fs, symlinkPath string)
- func SymlinkMustExistWithTragetPath(t *testing.T, fs afero.Fs, symlinkPath, expectedPointsTo string)
- func Uid(from os.FileInfo) int
- type ByLeastFilePathSeparators
- type ByMostFilePathSeparators
- type LinkOwner
- type SymlinkFs
- type SymlinkerFs
Constants ¶
This section is empty.
Variables ¶
var ( ErrSymlinkInfoExpected = errors.New("expecting a symlink file-info") ErrDirInfoExpected = errors.New("expecting a directory file-info") ErrFileInfoExpected = errors.New("expecting a file file-info") // internal package does not expose these errors ErrCopyFileFailed = errors.New("failed to copy file") ErrCopyDirFailed = errors.New("failed to copy directory") )
var ChmodBits = os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky
reference: os package
var ErrNoLchown = errors.New("lchown not supported")
ErrNoLchown is the error that will be wrapped in an os.Path if a file system does not support the lchown operation either directly or through its delegated filesystem. As expressed by support for the LinkOwner interface.
Functions ¶
func Chown ¶ added in v0.2.0
Chown is an operating system dependent implementation. only tries to change owner in cas ethat the owner differs
func CopySymlink ¶ added in v0.4.0
func CountFiles ¶ added in v0.7.1
func CreateSymlink ¶ added in v0.4.0
func DirContains ¶ added in v0.7.1
func FileMustContainText ¶
func IgnorableChownError ¶ added in v0.7.4
IgnorableChownError is solely used in Chown
func IgnorableChtimesError ¶ added in v0.7.4
IgnorableChtimesError is solely used for Chtimes
func IsInHiddenPath ¶ added in v0.7.1
func IsParentOfHiddenDir ¶ added in v0.7.1
func IterateDirTree ¶ added in v0.2.0
func LchownIfPossible ¶ added in v0.6.1
tries lchown, does not guarantee success
func LstatIfPossible ¶ added in v0.5.0
LstatIfPossible uses Lstat or stat in case it is possible. returns the fileinfo of the symlink or of the linked file or of the file in case there is no symlink. The second return value returns true in case Lstat was actually called, false otherwise.
func LstaterIfPossible ¶ added in v0.4.0
Check if interface is implemented
func RestoreFile ¶ added in v0.2.0
func RestoreSymlink ¶ added in v0.4.0
func SymlinkMustExist ¶ added in v0.4.0
func SymlinkMustExistWithTragetPath ¶ added in v0.4.0
Types ¶
type ByLeastFilePathSeparators ¶ added in v0.2.0
type ByLeastFilePathSeparators []string
ByLeastFilePathSeparators sorts the string by the number of file path separators the least nested the file path is, the further at the beginning it will be of the sorted string slice.
func (ByLeastFilePathSeparators) Len ¶ added in v0.2.0
func (a ByLeastFilePathSeparators) Len() int
func (ByLeastFilePathSeparators) Less ¶ added in v0.2.0
func (a ByLeastFilePathSeparators) Less(i, j int) bool
func (ByLeastFilePathSeparators) Swap ¶ added in v0.2.0
func (a ByLeastFilePathSeparators) Swap(i, j int)
type ByMostFilePathSeparators ¶ added in v0.2.0
type ByMostFilePathSeparators []string
ByMostFilePathSeparators sorts the string by the number of file path separators the more nested this is, the further at the beginning of the string slice the path will be
func (ByMostFilePathSeparators) Len ¶ added in v0.2.0
func (a ByMostFilePathSeparators) Len() int
func (ByMostFilePathSeparators) Less ¶ added in v0.2.0
func (a ByMostFilePathSeparators) Less(i, j int) bool
func (ByMostFilePathSeparators) Swap ¶ added in v0.2.0
func (a ByMostFilePathSeparators) Swap(i, j int)