Documentation
¶
Index ¶
- func CopyDir(src string, dst string) (err error)
- func CopyDirChildren(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CreateIfNotExist(path string) error
- func DeleteIfExists(path string) (existed bool, err error)
- func DownloadFile(filepath string, url string) error
- func Exists(path string) (bool, error)
- func Unzip(src string, dest string) ([]string, error)
- type ComponentConfigVar
- type ConfigVar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyDirChildren ¶
CopyDirChildren recursively copies a directory tree's children, attempting to preserve permissions. Source directory must exist, destination directory must exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func CreateIfNotExist ¶ added in v0.12.0
CreateIfNotExist will create the file at the specific path if it does not exist.
func DeleteIfExists ¶
DeleteIfExists will delete a file if it exists. If it doesn't, nothing happens. Returns if the file existed. If there was an error, existed is set to false, and err is set.
func DownloadFile ¶
DownloadFile will download a url to a local file. The network request attaches the "onepanelio" user-agent to the request headers This is important for certain sites like Github, otherwise you get a 403.