utils

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfWsl added in v0.7.2

func CheckIfWsl() bool

Checks based on uname if the linux environment is under wsl or not

func GetFileReferenceFromKubeconfig

func GetFileReferenceFromKubeconfig(
	filename string,
	kubeconfigPath string,
) (string, error)

func GetWslHostName added in v0.7.2

func GetWslHostName() string

Gets the subsystem host ip If the CLI is running under WSL the localhost url will not work so this function should return the real ip that we should redirect to

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser opens the specified URL in the default browser of the user.

func PromptPassword

func PromptPassword(prompt string) (string, error)

PromptPassword prompts a user to input a hidden field

func PromptPasswordWithConfirmation

func PromptPasswordWithConfirmation() (string, error)

PromptPasswordWithConfirmation is a helper function to prompt for a password twice

func PromptPlaintext

func PromptPlaintext(prompt string) (string, error)

PromptPlaintext prompts a user to input plain text

func PromptSelect

func PromptSelect(prompt string, options []string) (string, error)

func String

func String(length int) string

String returns a random string, pulling from a standard alphanumeric charset [a-zA-Z0-9]

func StringWithCharset

func StringWithCharset(length int, charset string) string

StringWithCharset returns a random string by pulling from a given charset

Types

This section is empty.

Jump to

Keyboard shortcuts

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