utils

package module
v0.0.0-...-a42a6ee Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 13 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRunTimeout = errors.New("command execution timeouts")

Functions

func Bytes2Human

func Bytes2Human(num float64) string

func GetFileMD5

func GetFileMD5(filename string) (string, error)

func GetIPRange

func GetIPRange(ip_start, ip_end string) ([]string, error)

func Md5

func Md5(c string) string

func ParseCommandArgs

func ParseCommandArgs(s string) []string

func ParsePort

func ParsePort(portString string) []int

func RunCmdWithTimeout

func RunCmdWithTimeout(cmd string, args []string, timeout int) ([]byte, error)

如果timeout为0, 则没有超时

func RunShell

func RunShell(cmd string) ([]byte, error)

func TrimSpaceAndNewLine

func TrimSpaceAndNewLine(str string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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