Documentation
¶
Index ¶
- type BasePathFile
- type BasePathFs
- func (f *BasePathFs) Close() error
- func (f *BasePathFs) Lstat(path string) (os.FileInfo, error)
- func (f *BasePathFs) MkdirChmodChown(path string, perm os.FileMode, uid, gid int) error
- func (f *BasePathFs) Open(path string) (File, error)
- func (f *BasePathFs) OpenFile(path string, flag int, perm os.FileMode) (File, error)
- func (f *BasePathFs) ReadDir(path string) ([]os.FileInfo, error)
- func (f *BasePathFs) Readlink(p string) (string, error)
- func (f *BasePathFs) Symlink(source, target string) error
- type File
- type Fs
- func (f Fs) AtomicWriteTo(source io.WriterTo, target string, perm os.FileMode) error
- func (f Fs) CreateTemp(dir, pattern string, perm os.FileMode) (File, error)
- func (f Fs) MkdirAll(path string, perm os.FileMode) error
- func (f Fs) MkdirAllChmodChown(path string, perm os.FileMode, uid, gid int) error
- func (f Fs) MkdirTemp(dir, pattern string, perm os.FileMode) (string, error)
- func (f Fs) ReadFile(path string) ([]byte, error)
- func (f Fs) RemoveIfExists(path string) error
- func (f Fs) SymlinkForce(old, new string) error
- func (f Fs) WriteFile(path string, data []byte, perm os.FileMode) error
- type FsBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasePathFile ¶
type BasePathFile struct {
afero.BasePathFile
}
func (*BasePathFile) Chown ¶
func (f *BasePathFile) Chown(uid, gid int) error
type BasePathFs ¶
type BasePathFs struct {
afero.BasePathFs
}
func (*BasePathFs) Close ¶
func (f *BasePathFs) Close() error
func (*BasePathFs) MkdirChmodChown ¶
func (*BasePathFs) Symlink ¶
func (f *BasePathFs) Symlink(source, target string) error
type Fs ¶
type Fs struct {
FsBackend
}
func NewBasePathFs ¶
func (Fs) AtomicWriteTo ¶
AtomicWriteTo writes data to the named file, creating it if necessary. A failure mid-operation results in no changes to the file (if it existed).
func (Fs) CreateTemp ¶
CreateTemp is like os.CreateTemp, but it treats an empty dir as the current directory.
func (Fs) MkdirAllChmodChown ¶
MkdirAllChmodChown creates a directory named path, along with any necessary parents. New directories will have the specified permissions (ignoring umask) and ownership.
func (Fs) MkdirTemp ¶
MkdirTemp is like os.MkdirTemp, but it treats an empty dir as the current directory.
func (Fs) RemoveIfExists ¶
RemoveIfExists is like os.Remove, but ignores os.ErrNotExist.
func (Fs) SymlinkForce ¶
SymlinkForce creates a symlink `new` pointing to `old`. If `new` already exists it is atomically overwritten.
type FsBackend ¶
type FsBackend interface {
io.Closer
Mkdir(path string, perm os.FileMode) error
MkdirChmodChown(path string, perm os.FileMode, uid, gid int) error
Open(path string) (File, error)
OpenFile(path string, flag int, perm os.FileMode) (File, error)
Symlink(old, new string) error
ReadDir(path string) ([]os.FileInfo, error)
Stat(path string) (os.FileInfo, error)
Lstat(path string) (os.FileInfo, error)
Readlink(path string) (string, error)
Rename(source, target string) error
Chmod(path string, mode os.FileMode) error
Chown(path string, uid, gid int) error
Chtimes(path string, atime time.Time, mtime time.Time) error
Remove(path string) error
RemoveAll(path string) error
}