util

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string)

CreateDirIfNotExist create dir

func DropHosts added in v0.0.12

func DropHosts(hostsMap map[string]string)

DropHosts ...

func DumpHosts added in v0.0.12

func DumpHosts(hostsMap map[string]string)

DumpHosts DumpToHosts

func GetOutboundIP

func GetOutboundIP() (address string)

GetOutboundIP Get preferred outbound ip of this machine

func GetRandomSSHPort

func GetRandomSSHPort(podIP string) string

GetRandomSSHPort get pod random ssh port

func HomeDir

func HomeDir() string

HomeDir Current User home dir

func IsDaemonRunning

func IsDaemonRunning(pidFile string) bool

IsDaemonRunning check daemon is running or not

func IsWindows added in v0.0.12

func IsWindows() bool

IsWindows check runtime is windows

func PrepareSSHPrivateKey added in v0.0.12

func PrepareSSHPrivateKey() (err error)

PrepareSSHPrivateKey generator ssh private key

func PrivateKeyPath added in v0.0.12

func PrivateKeyPath() string

PrivateKeyPath Get ssh private key path

func RandomString

func RandomString(n int) string

RandomString Generate RandomString

func String2Map added in v0.0.12

func String2Map(str string) map[string]string

String2Map Convert parameter string to real map "k1=v1,k2=v2" -> {"k1":"v1","k2","v2"}

func WritePidFile added in v0.0.12

func WritePidFile(pidFile string) (pid int, err error)

WritePidFile write pid to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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