Documentation ¶
Index ¶
- func Append(data string, dst string) (err error)
- func Copy(src, dst string) (err error)
- func CopyAndChangeMode(src, dst string, dirmode os.FileMode, filemode os.FileMode) (err error)
- func CopyResourceFile(srcFS fs.FS, srcFile, dst string, dirmode os.FileMode, filemode os.FileMode) error
- func Create(dst string, perm os.FileMode) (err error)
- func DirExists(path string) (exists bool, err error)
- func GenerateSHA1(path string) (hash string, err error)
- func GenerateSHA256(path string) (hash string, err error)
- func GetAbsPathWithBase(baseDirPath, inputPath string) string
- func IsDir(filePath string) (isDir bool, err error)
- func IsFile(path string) (isFile bool, err error)
- func Move(src, dst string) (err error)
- func PathExists(path string) (exists bool, err error)
- func ReadLines(path string) (lines []string, err error)
- func RemoveFileIfExists(path string) (err error)
- func Write(data string, dst string) (err error)
- func WriteLines(dataLines []string, destinationPath string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy copies a file from src to dst, creating directories for the destination if needed. dst is assumed to be a file and not a directory. Will preserve permissions.
func CopyAndChangeMode ¶
CopyAndChangeMode copies a file from src to dst, creating directories with the given access rights for the destination if needed. dst is assumed to be a file and not a directory. Will change the permissions to the given value.
func CopyResourceFile ¶
func CopyResourceFile(srcFS fs.FS, srcFile, dst string, dirmode os.FileMode, filemode os.FileMode) error
CopyResourceFile copies a file from an embedded binary resource file.
func GenerateSHA1 ¶
GenerateSHA1 calculates a sha1 of a file
func GenerateSHA256 ¶
GenerateSHA256 calculates a sha256 of a file
func GetAbsPathWithBase ¶
GetAbsPathWithBase converts 'inputPath' to an absolute path starting from 'baseDirPath', but only if it wasn't an absolute path in the first place.
func PathExists ¶
PathExists returns true if the path exists, false otherwise.
func ReadLines ¶
readLines reads file under path and returns lines as strings and any error encountered
func RemoveFileIfExists ¶
RemoveFileIfExists will delete a file if it exists on disk.
func WriteLines ¶
WriteLines writes each string to the same file, separated by lineSeparator (e.g. "\n").
Types ¶
This section is empty.