utils

package
v0.0.1-0...-07845db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string) (err error)

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 CopyFile

func CopyFile(src, dst string) (err error)

CopyFile from src to dst

func Download

func Download(filepath string, url string) (err error)

Download a resource from URL to given path

func EnsurerDir

func EnsurerDir(dir string) (err error)

Create Dir if not exist

func GetCurrentExecPath

func GetCurrentExecPath() (scriptPath string)

GetCurrentExecPath parses a path from running executable/go file

func GetHostIP

func GetHostIP() (ip net.IP)

GetHostIP returns the host's IP

func GetLangFromFileName

func GetLangFromFileName(fileName string) (lang string)

get programming language from file name extension

func HandleError

func HandleError(err error)

func IsPathExists

func IsPathExists(path string) (bool, error)

IsPathExists checks whether a path exists or if failed to check

func TarDir

func TarDir(srcDir string, desFileName string)

TarDir builds a tar from directory

func Unzip

func Unzip(source string, target string) (err error)

Unzip a folder to destination

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL