Documentation ¶
Index ¶
- func AppendToFile(filePath string, text string) error
- func CopyAll(srcDirPath, dstDirPath string, skipFileSuffix string) (err error)
- func CopyFile(source string, destination string) error
- func EnsureDirExists(dirpath string) (err error)
- func TempDir(dir string, prefix string) (string, error)
- type OSUtil
- func (fs OSUtil) AppendOrCreate(filePath string, text string) error
- func (fs OSUtil) Copy(source string, destination string) error
- func (fs OSUtil) CopyAll(source string, destination string) error
- func (fs OSUtil) Mkdirs(dir string) error
- func (fs OSUtil) OpenAndReadFile(file string) ([]byte, error)
- func (fs OSUtil) TempDir(dir string, prefix string) (string, error)
- type Util
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
AppendToFile adds text to a file
func CopyAll ¶ added in v1.1.5
CopyAll copies all files and directories inside `srcDirPath` to `dstDirPath`. Based on the CopyAll function from metaleap/go-utils
func EnsureDirExists ¶ added in v1.1.5
EnsureDirExists makes sure that the directory exists
Types ¶
type OSUtil ¶
type OSUtil struct { }
OSUtil is the struct for dealing with File System Operations on the disk.
func (OSUtil) AppendOrCreate ¶
AppendOrCreate adds text to file if it exists otherwise it creates a new file with the given text
func (OSUtil) OpenAndReadFile ¶
OpenAndReadFile is a util that will check if the file exists, open and then read the file.
type Util ¶
type Util interface { OpenAndReadFile(file string) ([]byte, error) CopyAll(source string, destination string) error Copy(source string, destination string) error TempDir(dir string, prefix string) (string, error) Mkdirs(dir string) error AppendOrCreate(filePath string, text string) error }
Util is an interface for helper file system utilities.
Click to show internal directories.
Click to hide internal directories.