cli

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKubectlFlagsToCmd

func AddKubectlFlagsToCmd(cmd *cobra.Command) clientcmd.ClientConfig

AddKubectlFlagsToCmd adds kubectl like flags to a command and returns the ClientConfig interface for retrieving the values.

func AskToProceed added in v0.4.0

func AskToProceed(message string) bool

AskToProceed prompts the user with a message (typically a yes or no question) and returns whether or not they responded in the affirmative or negative.

func MarshalLocalYAMLFile added in v0.3.0

func MarshalLocalYAMLFile(path string, obj interface{}) error

MarshalLocalYAMLFile writes JSON or YAML to a file on disk. The caller is responsible for checking error return values.

func NewVersionCmd

func NewVersionCmd(cliName string) *cobra.Command

NewVersionCmd returns a new `version` command to be used as a sub-command to root

func PromptCredentials added in v0.3.2

func PromptCredentials(username, password string) (string, string)

PromptCredentials is a helper to prompt the user for a username and password (unless already supplied)

func PromptMessage added in v0.4.0

func PromptMessage(message, value string) string

PromptMessage prompts the user for a value (unless already supplied)

func PromptPassword added in v0.4.0

func PromptPassword(password string) string

PromptPassword prompts the user for a password, without local echo. (unless already supplied)

func PromptUsername added in v0.4.0

func PromptUsername(username string) string

PromptUsername prompts the user for a username value

func UnmarshalLocalFile added in v0.3.0

func UnmarshalLocalFile(path string, obj interface{}) error

UnmarshalLocalFile retrieves JSON or YAML from a file on disk. The caller is responsible for checking error return values.

func UnmarshalRemoteFile added in v0.3.0

func UnmarshalRemoteFile(url string, obj interface{}) error

UnmarshalRemoteFile retrieves JSON or YAML through a GET request. The caller is responsible for checking error return values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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