Documentation
¶
Index ¶
- func BuildEnvVars(settings *config.Schema) []string
- func DetectContentType(filePath string) (ct string, err error)
- func DownloadFile(folder string, url string) (filename string, err error)
- func ExtractGzip(filePath, outFolder string) (err error)
- func FileExists(filePath string) bool
- func GenerateRandomHash() (h string, err error)
- func GetPath(pieces ...string) string
- func Hash(data ...interface{}) string
- func LoadJSON(filePath string, v interface{}) (err error)
- func SearchAndMove(root, file, targetPath string) (err error)
- func ShortHash(data ...string) string
- func StoreJSON(filePath string, v interface{}) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEnvVars ¶ added in v1.0.1
BuildEnvVars generates a sane base for environment variables to run shell commands with. It just includes $PATH
func DetectContentType ¶
DetectContentType detect the content type of a file
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
func ExtractGzip ¶
ExtractGzip extract a gzip file
func GenerateRandomHash ¶
GenerateRandomHash returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func SearchAndMove ¶
SearchAndMove search a file in a folder and move it to another path
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.