Documentation ¶
Index ¶
- Constants
- Variables
- func CmdExec(command string, timeout int, args ...string) ([]byte, error)
- func CmdExecShell(shell string, timeout int) ([]byte, error)
- func CmdExecShellDefault(shell string) ([]byte, error)
- func CurDatetime() string
- func Date(format string, timestamp ...int64) string
- func DateToTimestamp(dateStr string) int64
- func EscapeShellArg(arg string) string
- func GetNow() string
- func Hostname() string
- func Md5File(filePath string) (string, error)
- func TarPackage(workspace, pkgPath string, files []string, excludes []string) ([]byte, string, error)
- func Utc2LocalDate(d string) (string, error)
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 CmdExecShellDefault ¶
func CurDatetime ¶
func CurDatetime() string
func EscapeShellArg ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.