Documentation
¶
Index ¶
- type CopyOptions
- type FileManager
- type OsProxy
- type RealOS
- func (RealOS) Abs(path string) (string, error)
- func (RealOS) Chmod(name string, mode os.FileMode) error
- func (RealOS) Chown(name string, uid, gid int) error
- func (RealOS) Chtimes(name string, atime, mtime time.Time) error
- func (RealOS) Create(name string) (*os.File, error)
- func (RealOS) DirFS(dir string) fs.FS
- func (RealOS) Getwd() (string, error)
- func (RealOS) Lchown(name string, uid, gid int) error
- func (RealOS) Lstat(name string) (os.FileInfo, error)
- func (RealOS) Mkdir(name string, perm os.FileMode) error
- func (RealOS) MkdirAll(path string, perm os.FileMode) error
- func (RealOS) Open(name string) (*os.File, error)
- func (RealOS) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (RealOS) Readlink(name string) (string, error)
- func (RealOS) Remove(name string) error
- func (RealOS) RemoveAll(path string) error
- func (RealOS) Rename(oldpath, newpath string) error
- func (RealOS) Stat(name string) (os.FileInfo, error)
- func (RealOS) Symlink(oldname, newname string) error
- type SysStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyOptions ¶
type CopyOptions struct {
Overwrite bool // Overwrite replaces the destination file if it already exists.
}
CopyOptions configures a FileManager.CopyFile operation. A nil pointer means default behavior.
type FileManager ¶
type FileManager interface {
Open(path string) (*os.File, error)
OpenReaderIfExists(path string) (io.Reader, error)
ReadDirEntryNames(path string) ([]string, error)
Remove(path string) error
RemoveAll(path string) error
Write(path string, value string, perm os.FileMode) error
WriteBytes(path string, value []byte) error
FileSizeInBytes(pth string) (int64, error)
CopyFile(src, dst string, opts *CopyOptions) error
CopyFileFS(fsys fs.FS, src, dst string, opts *CopyOptions) error
CopyDir(src, dst string, opts *CopyOptions) error
Lstat(path string) (os.FileInfo, error)
LastNLines(s string, n int) string
}
FileManager ...
type OsProxy ¶
type OsProxy interface {
Stat(name string) (os.FileInfo, error)
Lstat(name string) (os.FileInfo, error)
Readlink(name string) (string, error)
Symlink(oldname, newname string) error
Mkdir(name string, perm os.FileMode) error
MkdirAll(path string, perm os.FileMode) error
Open(name string) (*os.File, error)
Create(name string) (*os.File, error)
Remove(name string) error
RemoveAll(path string) error
Rename(oldpath, newpath string) error
Chmod(name string, mode os.FileMode) error
Chown(name string, uid, gid int) error
Chtimes(name string, atime, mtime time.Time) error
Getwd() (string, error)
Abs(path string) (string, error)
DirFS(dir string) fs.FS
OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
Lchown(name string, uid, gid int) error
}
OsProxy defines the subset of os package functions we want to proxy. Add more methods as you need them.
Click to show internal directories.
Click to hide internal directories.