Documentation ¶
Index ¶
- type FileSystem
- func (s *FileSystem) CreateDirectoryIfNotExists(path string) error
- func (s *FileSystem) CreateFile(filename string) (afero.File, error)
- func (s *FileSystem) CreateFileIfNotExists(filename string) (afero.File, error)
- func (s *FileSystem) GetAferoFs() afero.Fs
- func (s *FileSystem) ReadDir(path string) ([]string, error)
- func (s *FileSystem) ReadFile(filePath string) (string, error)
- func (s *FileSystem) ReadFileFromURL(url string) (string, error)
- func (s *FileSystem) WriteFile(filename string, content string) error
- type FileSystemInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
func NewFileSystem ¶
func NewFileSystem(fs afero.Fs) *FileSystem
func (*FileSystem) CreateDirectoryIfNotExists ¶
func (s *FileSystem) CreateDirectoryIfNotExists(path string) error
CreateDirectoryIfNotExists creates a directory if it does not already exist.
func (*FileSystem) CreateFile ¶
func (s *FileSystem) CreateFile(filename string) (afero.File, error)
CreateFile creates or truncates the named file.
func (*FileSystem) CreateFileIfNotExists ¶
func (s *FileSystem) CreateFileIfNotExists(filename string) (afero.File, error)
CreateFileIfNotExists creates a file if it does not already exist.
func (*FileSystem) GetAferoFs ¶
func (s *FileSystem) GetAferoFs() afero.Fs
func (*FileSystem) ReadDir ¶
func (s *FileSystem) ReadDir(path string) ([]string, error)
ReadDir reads the directory named by path and returns a slice of file names.
func (*FileSystem) ReadFile ¶
func (s *FileSystem) ReadFile(filePath string) (string, error)
ReadFile reads the content of a file and returns it as a string.
func (*FileSystem) ReadFileFromURL ¶
func (s *FileSystem) ReadFileFromURL(url string) (string, error)
type FileSystemInterface ¶
type FileSystemInterface interface { GetAferoFs() afero.Fs CreateDirectoryIfNotExists(path string) error ReadFile(filePath string) (string, error) CreateFileIfNotExists(filename string) (afero.File, error) CreateFile(filename string) (afero.File, error) WriteFile(filename string, content string) error ReadDir(path string) ([]string, error) ReadFileFromURL(url string) (string, error) }
Click to show internal directories.
Click to hide internal directories.