Documentation ¶
Index ¶
- Constants
- func PrintFsErr(errorName filesystemErr, opt ...interface{}) error
- type FileSystem
- type FileSystemImpl
- func (f FileSystemImpl) CommandExec(path string, name string, args ...string) error
- func (f FileSystemImpl) CreateFile(path string, fileName string, fileTemplate string) error
- func (f FileSystemImpl) CreateFileIfNotExists(path string, fileName string, fileTemplate string) error
- func (f FileSystemImpl) CreateFolder(path string) error
- func (f FileSystemImpl) CreateFolderIfNotExists(path string) error
- func (f FileSystemImpl) DeleteFile(path string) error
- func (f FileSystemImpl) DeleteFolder(path string) error
- func (f FileSystemImpl) IsFileExists(filepath string) bool
- func (f FileSystemImpl) IsFolderEmpty(path string) bool
- func (f FileSystemImpl) IsFolderExists(path string) bool
- func (f FileSystemImpl) ReadFile(path string) (string, error)
- func (f FileSystemImpl) ReadFolderList(path string) ([]string, error)
- func (f FileSystemImpl) ReplaceFile(path string, fileName string, fileTemplate string) error
Constants ¶
View Source
const ( PathNotSet filesystemErr = "Path is not set" FileNotFoundErr filesystemErr = "File is not found" FileIsNotFileButADir filesystemErr = "File is not a file but it's a directory" FileIsNotDirButAFile filesystemErr = "File is not a directory but it's a file" FileWasCreated filesystemErr = "File already created" FolderWasCreated filesystemErr = "Folder already created %s" GoFmtErr filesystemErr = "Failed to run go fmt" GitinitErr filesystemErr = "Failed to run gitinit, maybe git isn't installed on your device" MkdirErr filesystemErr = "Failed to create a folder" MkfileErr filesystemErr = "Failed to create a file" )
Variables ¶
This section is empty.
Functions ¶
func PrintFsErr ¶
func PrintFsErr(errorName filesystemErr, opt ...interface{}) error
panicErr return an error message
Types ¶
type FileSystem ¶
type FileSystem interface { IsFileExists(filepath string) bool IsFolderExists(path string) bool IsFolderEmpty(path string) bool CreateFolder(path string) error CreateFolderIfNotExists(path string) error CreateFile(path string, fileName string, fileTemplate string) error CreateFileIfNotExists(path string, fileName string, fileTemplate string) error DeleteFolder(path string) error DeleteFile(path string) error ReadFile(path string) (string, error) ReadFolderList(path string) ([]string, error) ReplaceFile(path string, fileName string, fileTemplate string) error CommandExec(path string, name string, args ...string) error // contains filtered or unexported methods }
type FileSystemImpl ¶
type FileSystemImpl struct { }
func NewFileSystem ¶
func NewFileSystem() *FileSystemImpl
func (FileSystemImpl) CommandExec ¶
func (f FileSystemImpl) CommandExec(path string, name string, args ...string) error
func (FileSystemImpl) CreateFile ¶
func (f FileSystemImpl) CreateFile(path string, fileName string, fileTemplate string) error
func (FileSystemImpl) CreateFileIfNotExists ¶
func (f FileSystemImpl) CreateFileIfNotExists(path string, fileName string, fileTemplate string) error
func (FileSystemImpl) CreateFolder ¶
func (f FileSystemImpl) CreateFolder(path string) error
func (FileSystemImpl) CreateFolderIfNotExists ¶
func (f FileSystemImpl) CreateFolderIfNotExists(path string) error
func (FileSystemImpl) DeleteFile ¶
func (f FileSystemImpl) DeleteFile(path string) error
func (FileSystemImpl) DeleteFolder ¶
func (f FileSystemImpl) DeleteFolder(path string) error
func (FileSystemImpl) IsFileExists ¶
func (f FileSystemImpl) IsFileExists(filepath string) bool
func (FileSystemImpl) IsFolderEmpty ¶
func (f FileSystemImpl) IsFolderEmpty(path string) bool
func (FileSystemImpl) IsFolderExists ¶
func (f FileSystemImpl) IsFolderExists(path string) bool
func (FileSystemImpl) ReadFolderList ¶
func (f FileSystemImpl) ReadFolderList(path string) ([]string, error)
func (FileSystemImpl) ReplaceFile ¶
func (f FileSystemImpl) ReplaceFile(path string, fileName string, fileTemplate string) error
Click to show internal directories.
Click to hide internal directories.