Documentation ¶
Index ¶
- type FileSystem
- type LinuxFileSystem
- func (l *LinuxFileSystem) EvalSymlinks(path string) (string, error)
- func (l *LinuxFileSystem) Glob(pattern string) ([]string, error)
- func (l *LinuxFileSystem) PathExists(path string) (bool, error)
- func (l *LinuxFileSystem) ReadDir(dirname string) ([]os.FileInfo, error)
- func (l *LinuxFileSystem) ReadFile(filepath string) ([]byte, error)
- func (l *LinuxFileSystem) WriteToFile(filepath string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem interface { Glob(pattern string) ([]string, error) PathExists(path string) (bool, error) ReadFile(filepath string) ([]byte, error) WriteToFile(filepath string, data []byte) error EvalSymlinks(path string) (string, error) ReadDir(dirname string) ([]os.FileInfo, error) }
FileSystem is an interface for interacting with the filesystem
type LinuxFileSystem ¶
type LinuxFileSystem struct { }
LinuxFileSystem is an implementation of Filesystem available for use from this package
func (*LinuxFileSystem) EvalSymlinks ¶
func (l *LinuxFileSystem) EvalSymlinks(path string) (string, error)
EvalSymlinks is a shim implementation on top of `filepath.EvalSymlinks`
func (*LinuxFileSystem) Glob ¶
func (l *LinuxFileSystem) Glob(pattern string) ([]string, error)
Glob globs things
func (*LinuxFileSystem) PathExists ¶
func (l *LinuxFileSystem) PathExists(path string) (bool, error)
PathExists returns a bool reflecting if a path exists, or not
func (*LinuxFileSystem) ReadDir ¶
func (l *LinuxFileSystem) ReadDir(dirname string) ([]os.FileInfo, error)
ReadDir is a shim for ioutil.ReadDir
func (*LinuxFileSystem) ReadFile ¶
func (l *LinuxFileSystem) ReadFile(filepath string) ([]byte, error)
ReadFile reads a file into a byte slice
func (*LinuxFileSystem) WriteToFile ¶
func (l *LinuxFileSystem) WriteToFile(filepath string, data []byte) error
WriteToFile writes a bytestream to a file.
Click to show internal directories.
Click to hide internal directories.