Documentation ¶
Overview ¶
TODO: meloniam@ https://sim.amazon.com/issues/SSM-3322 TODO: This package is a start to migration of the fileutil code to be inside an interface for better mocking. Package filemanager have all the file related dependencies used by the execute package
Index ¶
- type FileSystem
- type FileSystemImpl
- func (f FileSystemImpl) AppendToFile(fileDirectory string, filename string, content string) (filePath string, err error)
- func (f FileSystemImpl) DeleteDirectory(filename string) (err error)
- func (f FileSystemImpl) DeleteFile(filename string) (err error)
- func (f FileSystemImpl) Exists(root string) bool
- func (f FileSystemImpl) IsDirectory(srcPath string) bool
- func (f FileSystemImpl) MakeDirs(destinationDir string) (err error)
- func (f FileSystemImpl) MoveAndRenameFile(sourcePath, sourceName, destPath, destName string) (result bool, err error)
- func (f FileSystemImpl) ReadFile(filename string) (string, error)
- func (f FileSystemImpl) WriteFile(filename string, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem interface { MakeDirs(destinationDir string) (err error) WriteFile(filename string, content string) error ReadFile(filename string) (string, error) MoveAndRenameFile(sourcePath, sourceName, destPath, destName string) (result bool, err error) DeleteFile(filename string) (err error) DeleteDirectory(filename string) (err error) Exists(filename string) bool IsDirectory(srcPath string) bool AppendToFile(fileDirectory string, filename string, content string) (filePath string, err error) }
FileSystem implements dependency on filesystem and os utility functions
type FileSystemImpl ¶
type FileSystemImpl struct{}
func (FileSystemImpl) AppendToFile ¶
func (f FileSystemImpl) AppendToFile(fileDirectory string, filename string, content string) (filePath string, err error)
AppendToFile appends contents to file
func (FileSystemImpl) DeleteDirectory ¶
func (f FileSystemImpl) DeleteDirectory(filename string) (err error)
DeleteDirectory deletes the file
func (FileSystemImpl) DeleteFile ¶
func (f FileSystemImpl) DeleteFile(filename string) (err error)
DeleteFile deletes the file
func (FileSystemImpl) Exists ¶
func (f FileSystemImpl) Exists(root string) bool
func (FileSystemImpl) IsDirectory ¶
func (f FileSystemImpl) IsDirectory(srcPath string) bool
func (FileSystemImpl) MakeDirs ¶
func (f FileSystemImpl) MakeDirs(destinationDir string) (err error)
MakeDirs creates a directory with execute access
func (FileSystemImpl) MoveAndRenameFile ¶
func (f FileSystemImpl) MoveAndRenameFile(sourcePath, sourceName, destPath, destName string) (result bool, err error)
MoveAndRenameFile moves and renames the file
Click to show internal directories.
Click to hide internal directories.