Documentation ¶
Index ¶
- func EnvUsername() (string, error)
- func ExecCmd(binName string, args []string, workDir ...string) (string, error)
- func Exists(pid int) bool
- func Exit(code int, info string, err error)
- func ForceGC()
- func ForceGCNonBlocking()
- func GetDiskUsage(path string) (used, free, total uint64)
- func GetMemoryUsage() uint64
- func Input(s ...string) (string, error)
- func InputPassword(s ...string) string
- func IsCentOS() bool
- func IsCentOS8() bool
- func IsFreeBSD() bool
- func IsLinux() bool
- func IsMac() bool
- func IsRHEL() bool
- func IsRHEL8() bool
- func IsRHELLike() bool
- func IsUnixLike() bool
- func IsWin() bool
- func Kill(pid int, signal syscall.Signal) error
- func OSUsername() (string, error)
- func QuickExec(cmdLine string, workDir ...string) (string, error)
- func ShellExec(cmdStr string, shells ...string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvUsername ¶
EnvUsername returns the username from the OS environment.
func GetDiskUsage ¶
GetDiskUsage returns the disk usage of given path as bytes.
func GetMemoryUsage ¶
func GetMemoryUsage() uint64
GetMemoryUsage returns the size of memory used by this program as bytes.
func Input ¶
Input read one line from user input. Usage:
in := Input() ans, _ := Input("your name?")
func OSUsername ¶
OSUsername returns the username of the current OS user (based on UID).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.