utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2018 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KB .
	KB = 1024
	// MB .
	MB = 1024 * KB
	// GB .
	GB = 1024 * MB
	// TB .
	TB = 1024 * GB
)

Variables

View Source
var ErrPackageEmpty = errors.New("package can't be empty")

ErrPackageEmpty .

View Source
var ErrVersionName = errors.New("version must be v.X.X.X example v0.0.1 v1.0.0")

ErrVersionName .

Functions

func ABS added in v0.1.0

func ABS(src string) string

ABS 如果 路徑不是 絕對路徑 以程式所在目錄 轉爲絕對路徑

func CheckVersion

func CheckVersion(v string) (e error)

CheckVersion .

func HashFile

func HashFile(filename string) (hash string, e error)

HashFile .

func Rprint added in v0.1.0

func Rprint(last int, a ...interface{}) int

Rprint \r Print

func Rprintf added in v0.1.0

func Rprintf(last int, format string, a ...interface{}) int

Rprintf \r Printf

func SizeString

func SizeString(size int64) (str string)

SizeString 返回 數據大小 字符串

func UnpackTarGzip

func UnpackTarGzip(src, dst string) (e error)

UnpackTarGzip 解開 tar 包

func UnpackTarGzipFile

func UnpackTarGzipFile(src, name string) (b []byte, e error)

UnpackTarGzipFile 返回 tar 中 指定檔案 的 數據

Types

This section is empty.

Jump to

Keyboard shortcuts

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