misc

package
v0.0.0-...-f0721d9 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: GPL-3.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func CsvToJson

func CsvToJson(csvInput string) (string, error)

parses the raw stats CSV output to a json string

func CsvToMap

func CsvToMap(csvInput string) (map[string]map[string]string, error)

parses the raw stats CSV output to a map

func GetIPSafe

func GetIPSafe(h string) (string, error)

func GetLocalIP

func GetLocalIP() string

Get local host IP

func GetMD5Hash

func GetMD5Hash(text string) string

func GetUUID

func GetUUID() string

func MultiLineToJson

func MultiLineToJson(multiLineInput string) (string, error)

func SetValueFromEnv

func SetValueFromEnv(field interface{}, envVar string)

func SplitHostPort

func SplitHostPort(s string) (string, string)

Returns two host and port items from a pair, e.g. host:port

func SplitPair

func SplitPair(s string) (string, string)

Returns generic items from a pair, e.g. user:pass

func ValidateHostPort

func ValidateHostPort(h string, p string) bool

Validate server host and port

Types

This section is empty.

Jump to

Keyboard shortcuts

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