Documentation ¶
Index ¶
- func ChownFileUsername(filename, username string) error
- func CopyFile(src, dst string) (err error)
- func CreateFile(path string) error
- func DeleteDirContent(dir string) error
- func DeleteFile(path string) error
- func Download(client *minio.Client, bucketName, filePath, objectName string) ([]byte, error)
- func ExecCommand(name string, args ...string) (string, error)
- func Exists(name string) bool
- func GetCurrentTime() time.Time
- func GetFileSize(FilePath string) int64
- func GetRootProjectDir() string
- func Getwd() (string, error)
- func IsDirectory(path string) (bool, error)
- func ReadAll(filePath string) ([]byte, error)
- func SliceContainsString(a string, list []string) bool
- func StartCommand(name string, args ...string) error
- func StringInSlice(a string, list []string) bool
- func UniqueSlice(slice []string) []string
- func WalkAllFilesInDir(dir string) ([]string, error)
- func WriteBytesFile(filename string, r io.Reader) (int, error)
- func ZipDecrypt(zipFilepath string, password string) error
- func ZipEncrypt(filename string, password string, contents io.Reader) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChownFileUsername ¶
ChownFileUsername executes chown username:username filename.
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.
func DeleteDirContent ¶ added in v0.0.4
DeleteDirContent delete all files from a folder without deleting the parent directory.
func ExecCommand ¶
ExecCommand runs cmd on file.
func GetRootProjectDir ¶
func GetRootProjectDir() string
GetRootProjectDir retrieves `saferwall` root src project directory.
func IsDirectory ¶
IsDirectory returns true if path is a directory.
func SliceContainsString ¶
SliceContainsString returns if slice contains substring.
func StartCommand ¶
StartCommand will execute a command in background.
func StringInSlice ¶
StringInSlice returns whether or not a string exists in a slice.
func UniqueSlice ¶
UniqueSlice delete duplicate strings from an array of strings.
func WalkAllFilesInDir ¶
WalkAllFilesInDir returns list of files in directory.
func WriteBytesFile ¶
WriteBytesFile write Bytes to a File.
func ZipDecrypt ¶ added in v0.0.2
ZipDecrypt compresses binary data to zip using a password.
Types ¶
This section is empty.