database

package
v0.0.0-...-4f71f7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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) ReadFile

func (f FileSystemImpl) ReadFile(path string) (string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL