Documentation
¶
Index ¶
- func CreateTemp(dir, pattern string) (*os.File, error)
- func Getwd() (string, error)
- func Lstat(name string) (fs.FileInfo, error)
- func MkdirAll(path string, perm fs.FileMode) error
- func Open(name string) (*os.File, error)
- func OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
- func ReadDir(name string) ([]os.DirEntry, error)
- func ReadFile(name string) ([]byte, error)
- func Remove(name string) error
- func Rename(oldpath, newpath string) error
- func Stat(name string) (fs.FileInfo, error)
- func UserHomeDir() (string, error)
- func WriteFile(name string, data []byte, perm fs.FileMode) error
- type FS
- type OsFs
- func (OsFs) CreateTemp(dir, pattern string) (*os.File, error)
- func (OsFs) Getwd() (string, error)
- func (OsFs) Lstat(name string) (fs.FileInfo, error)
- func (OsFs) MkdirAll(path string, perm fs.FileMode) error
- func (OsFs) Open(name string) (*os.File, error)
- func (OsFs) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
- func (OsFs) ReadDir(name string) ([]os.DirEntry, error)
- func (OsFs) ReadFile(name string) ([]byte, error)
- func (OsFs) Remove(name string) error
- func (OsFs) Rename(oldpath, newpath string) error
- func (OsFs) Stat(name string) (fs.FileInfo, error)
- func (OsFs) UserHomeDir() (string, error)
- func (OsFs) WriteFile(name string, data []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UserHomeDir ¶
Types ¶
type FS ¶
type FS interface {
// Query
Stat(name string) (fs.FileInfo, error)
Lstat(name string) (fs.FileInfo, error)
Getwd() (string, error)
UserHomeDir() (string, error)
// Read/Write
ReadFile(name string) ([]byte, error)
WriteFile(name string, data []byte, perm fs.FileMode) error
Open(name string) (*os.File, error)
OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)
CreateTemp(dir, pattern string) (*os.File, error)
// Directory/File management
MkdirAll(path string, perm fs.FileMode) error
ReadDir(name string) ([]os.DirEntry, error)
Remove(name string) error
Rename(oldpath, newpath string) error
}
FS abstracts filesystem operations used across the project. Implementations must behave identically to the corresponding os package functions.
Click to show internal directories.
Click to hide internal directories.