helper

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// IsGnuTar show tar type
	IsGnuTar = false
)

Functions

func CleanHost

func CleanHost(host string) string

CleanHost clean host url ftp://foo.bar.com -> foo.bar.com

func CreateCmd

func CreateCmd(command string, args ...string) (cmd *exec.Cmd, err error)

CreateCmd

func Exec

func Exec(command string, args ...string) (output string, err error)

Exec cli commands

func ExplandHome

func ExplandHome(filePath string) string

ExplandHome ~/foo -> /home/jason/foo

func IsExistsPath

func IsExistsPath(p string) bool

IsExistsPath check path exist

func MkdirP

func MkdirP(dirPath string)

MkdirP like mkdir -p

Types

type ProgressBar added in v0.2.4

type ProgressBar struct {
	FileLength int64
	Reader     io.Reader
	// contains filtered or unexported fields
}

func NewProgressBar added in v0.2.4

func NewProgressBar(myLogger logger.Logger, reader *os.File) ProgressBar

func (ProgressBar) Done added in v0.2.4

func (p ProgressBar) Done(url string)

func (ProgressBar) Errorf added in v0.2.4

func (p ProgressBar) Errorf(format string, err ...any) error

Jump to

Keyboard shortcuts

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