Documentation ¶
Index ¶
- Constants
- Variables
- func ChkMd5Info(filepath string, md5Str string) error
- func Confirm(promptStr string) bool
- func ConvertHomeDir(raw string) (string, error)
- func DirExist(dirpath string) bool
- func ExecLinuxCmd(cmdStr string) ([]byte, error)
- func FileExist(filepath string) bool
- func IsDir(filepath string) bool
- func IsWildCharMatch(s string, wildCharStrs ...string) bool
- func LocalPathSize(dirPath string) (int64, error)
- func LoginNo(promptStr string, min, max int) int
- func Md5File(filepath string) (string, error)
- func NewProgressBar(prefix string, count int64) *pb.ProgressBar
- func PostFile(fileParam, filePath string, extraParams map[string]string, targetURL string) error
- func TarGz(src string, dstTgz string, ow bool) error
- func Trim(s string, cutsets ...string) string
- func UnTarGz(srcTarGz string, dstDir string) error
- func WildCharToRegexp(s string) string
Constants ¶
View Source
const HomeDirFlag = "~"
HomeDirFlag 当前用户家目录标识符
Variables ¶
View Source
var ( FgYellow = color.New(color.FgYellow).SprintFunc() FgBlue = color.New(color.FgBlue).SprintFunc() FgRed = color.New(color.FgRed).SprintFunc() FgCyan = color.New(color.FgCyan).SprintFunc() FgGreen = color.New(color.FgGreen).SprintFunc() FgBoldYellow = color.New(color.FgYellow, color.Bold).SprintFunc() FgBoldBlue = color.New(color.FgBlue, color.Bold).SprintFunc() FgBoldRed = color.New(color.FgRed, color.Bold).SprintFunc() FgBoldCyan = color.New(color.FgCyan, color.Bold).SprintFunc() FgBoldGreen = color.New(color.FgGreen, color.Bold).SprintFunc() BgYellow = color.New(color.BgYellow).SprintFunc() BgBlue = color.New(color.BgBlue).SprintFunc() BgRed = color.New(color.BgRed).SprintFunc() BgCyan = color.New(color.BgCyan).SprintFunc() BgGreen = color.New(color.BgGreen).SprintFunc() BgBoldYellow = color.New(color.BgYellow, color.Bold).SprintFunc() BgBoldBlue = color.New(color.BgBlue, color.Bold).SprintFunc() BgBoldRed = color.New(color.BgRed, color.Bold).SprintFunc() BgBoldCyan = color.New(color.BgCyan, color.Bold).SprintFunc() BgBoldGreen = color.New(color.BgGreen, color.Bold).SprintFunc() )
View Source
var ( // ErrFileExisted error message when file exist ErrFileExisted = "target file %s is existed" // ErrMd5Check error message when check md5 ErrMd5Check = "md5 is not same: Origin MD5(%s)\tCurrent MD5(%s)" )
View Source
var ErrUploadFile = "upload file failed: URL(%s)\nfilename(%s)\nmessage(%s)"
ErrUploadFile error message when upload file failed
Functions ¶
func ChkMd5Info ¶
ChkMd5Info check md5 info is same or not
func ConvertHomeDir ¶
ConvertHomeDir convert ~ to user's home dir
func IsWildCharMatch ¶
IsWildCharMatch check s is match one of wildCharStrs or not
func LocalPathSize ¶ added in v0.6.5
LocalPathSize directory size with all file in it
func NewProgressBar ¶ added in v0.6.5
func NewProgressBar(prefix string, count int64) *pb.ProgressBar
func WildCharToRegexp ¶
WildCharToRegexp change string with wildchar to regexp format string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.