Documentation
¶
Overview ¶
Package osfs provides a filesystem adapter using the standard library os package.
Index ¶
- type OSFileSystem
- func (f *OSFileSystem) Create(name string) (*os.File, error)
- func (f *OSFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (f *OSFileSystem) Open(name string) (fs.File, error)
- func (f *OSFileSystem) ReadDir(name string) ([]os.DirEntry, error)
- func (f *OSFileSystem) ReadFile(name string) ([]byte, error)
- func (f *OSFileSystem) Remove(name string) error
- func (f *OSFileSystem) RemoveAll(path string) error
- func (f *OSFileSystem) Rename(oldpath, newpath string) error
- func (f *OSFileSystem) Stat(name string) (os.FileInfo, error)
- func (f *OSFileSystem) Walk(root string, fn ports.WalkFunc) error
- func (f *OSFileSystem) WriteFile(name string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OSFileSystem ¶
type OSFileSystem struct{}
OSFileSystem implements ports.FileSystem using the standard library.
func (*OSFileSystem) Create ¶
func (f *OSFileSystem) Create(name string) (*os.File, error)
Create creates or truncates the named file.
func (*OSFileSystem) MkdirAll ¶
func (f *OSFileSystem) MkdirAll(path string, perm os.FileMode) error
MkdirAll creates a directory along with any necessary parents.
func (*OSFileSystem) Open ¶
func (f *OSFileSystem) Open(name string) (fs.File, error)
Open opens the named file for reading.
func (*OSFileSystem) ReadDir ¶
func (f *OSFileSystem) ReadDir(name string) ([]os.DirEntry, error)
ReadDir reads the named directory and returns directory entries.
func (*OSFileSystem) ReadFile ¶
func (f *OSFileSystem) ReadFile(name string) ([]byte, error)
ReadFile reads the named file and returns the contents.
func (*OSFileSystem) Remove ¶
func (f *OSFileSystem) Remove(name string) error
Remove removes the named file or empty directory.
func (*OSFileSystem) RemoveAll ¶
func (f *OSFileSystem) RemoveAll(path string) error
RemoveAll removes path and any children it contains.
func (*OSFileSystem) Rename ¶
func (f *OSFileSystem) Rename(oldpath, newpath string) error
Rename renames (moves) oldpath to newpath.
func (*OSFileSystem) Stat ¶
func (f *OSFileSystem) Stat(name string) (os.FileInfo, error)
Stat returns file info for the named file.
Click to show internal directories.
Click to hide internal directories.