Documentation
¶
Index ¶
- Variables
- func ExtractHost(remoteAddr string) string
- func FileExists(filename string) (exist, isDir bool)
- func GenLocalCertAuthPath(remoteAddr string) string
- func GenLocalCertClientKeyPath(remoteAddr string) string
- func GenLocalCertClientPath(remoteAddr string) string
- func GetHost(srvAddr string) string
- func GetHostAndPort(addr string) (string, string)
- func GetHostname(addr string) string
- func GetLocalKubePath() string
- func GetPort(srvAddr string) (port int, notFound bool)
- func IsAvailable(port int) bool
- func SshHost(user, ip string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBaseConfigDir string DefaultCacheDir string DefaultCertDir string DefaultHistoryPath string LocalKubeConfigPath = "~/.kube/config" ErrFailedCreateCacheDir = errors.New("failed to create cache dir") ErrFailedCreateCertDir = errors.New("failed to create cert dir") ErrFailedCreateHistory = errors.New("failed to create history file") )
Functions ¶
func ExtractHost ¶
ExtractHost extracts host info from remoteAddr which is in the format `user@host`
func FileExists ¶
FileExists checks if a file exists refer, https://golangcode.com/check-if-a-file-exists/
func GenLocalCertAuthPath ¶
GenLocalCertAuthPath creates local path for remote cert-auth file
func GenLocalCertClientKeyPath ¶
GenLocalCertClientKeyPath creates local path for remote client-key file
func GenLocalCertClientPath ¶
GenLocalCertClientPath creates local path for remote client-cert file
func GetHostAndPort ¶
func GetHostname ¶
TODO: add tests GetHostname returns host, stripping any valid port number if present.
func GetLocalKubePath ¶
func GetLocalKubePath() string
GetLocalKubePath returns local kubeconfig absolute path.
func IsAvailable ¶
IsAvailable tests whether given port is available on localhost.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.