libs

package
v0.0.0-...-53d016b Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIME_FORMAT          = "2006-01-02 15:04:05"
	TIME_FORMAT_YYYYMMDD = "20060102"
)

Variables

View Source
var TimeFormatMap = map[string]string{
	"Y": "2006",
	"m": "01",
	"d": "02",
	"H": "15",
	"i": "04",
	"s": "05",
}

Functions

func CmdExec

func CmdExec(command string, timeout int, args ...string) ([]byte, error)

execute command with timeout

func CmdExecShell

func CmdExecShell(shell string, timeout int) ([]byte, error)

func CmdExecShellDefault

func CmdExecShellDefault(shell string) ([]byte, error)

func CurDatetime

func CurDatetime() string

func Date

func Date(format string, timestamp ...int64) string

*

  • 类似php的date()函数 *
  • @param
  • @return *

func DateToTimestamp

func DateToTimestamp(dateStr string) int64

*

  • 将日期(字符串)转为时间戳

func EscapeShellArg

func EscapeShellArg(arg string) string

EscapeShellArg() adds single quotes around a string and quotes/escapes any existing single quotes allowing you to pass a string directly to a shell function and having it be treated as a single safe argument.

func GetNow

func GetNow() string

func Hostname

func Hostname() string

func Md5File

func Md5File(filePath string) (string, error)

func TarPackage

func TarPackage(workspace, pkgPath string, files []string, excludes []string) ([]byte, string, error)

pack version package

func Utc2LocalDate

func Utc2LocalDate(d string) (string, error)

UTC 时间转本地时间

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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