cliutil

package
v1.13.0-beta11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 24 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskOne

func AskOne(p survey.Prompt, response interface{}, v survey.Validator, opts ...survey.AskOpt) error

func ChooseBool

func ChooseBool(message string, target *bool) error

func ChooseFromList

func ChooseFromList(message string, choice *string, options []string) error

func Contains

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

TODO(mitchdraft) move this to a util file

func EnsureCsv

func EnsureCsv(message string, source string, target *[]string, staticMode bool) error

func EnsureKVCsv

func EnsureKVCsv(message string, source string, target *map[string]string, staticMode bool) error

Expected format of source: k1,v1,k2,v2

func GetBoolInput

func GetBoolInput(msg string, value *bool) error

func GetBoolInputDefault

func GetBoolInputDefault(msg string, value *bool, defaultValue bool) error

func GetFreePort added in v1.3.13

func GetFreePort() (int, error)

func GetIngressHost added in v0.13.8

func GetIngressHost(ctx context.Context, proxyName, proxyNamespace, proxyPort string, localCluster bool, clusterName string) (string, error)

GetIngressHost returns the host address of the ingress

func GetLogger added in v0.13.3

func GetLogger() io.Writer

func GetLogsPath added in v0.13.3

func GetLogsPath() string

func GetResource

func GetResource(uri string) (io.ReadCloser, error)

GetResource identified by the given URI. The URI can either be a http(s) address or a relative/absolute file path.

func GetStringInput

func GetStringInput(msg string, value *string) error

func GetStringInputDefault

func GetStringInputDefault(msg string, value *string, defaultValue string) error

func GetStringInputDefaultLazyPrompt added in v0.18.0

func GetStringInputDefaultLazyPrompt(msgProvider func() string, value *string, defaultValue string) error

func GetStringInputLazyPrompt added in v0.18.0

func GetStringInputLazyPrompt(msgProvider func() string, value *string) error

func GetStringSliceInput

func GetStringSliceInput(msg string, value *[]string) error

func GetStringSliceInputLazyPrompt added in v0.18.0

func GetStringSliceInputLazyPrompt(msgProvider func() string, value *[]string) error

func GetUint32Input

func GetUint32Input(msg string, value *uint32) error

func GetUint32InputDefault

func GetUint32InputDefault(msg string, value *uint32, defaultValue uint32) error

func GetYesInput

func GetYesInput(msg string) (bool, error)

func Initialize added in v0.13.3

func Initialize() error

func MultiChooseFromList added in v0.18.1

func MultiChooseFromList(message string, choices *[]string, options []string) error

func PortForward added in v1.3.13

func PortForward(namespace string, resource string, localPort string, kubePort string, verbose bool) (*exec.Cmd, error)

PortForward call kubectl port-forward. Callers are expected to clean up the returned portFwd *exec.cmd after the port-forward is no longer needed.

func PortForwardGet added in v1.3.13

func PortForwardGet(ctx context.Context, namespace string, resource string, localPort string, kubePort string, verbose bool, getPath string) (string, *exec.Cmd, error)

PortForwardGet call kubectl port-forward and make a GET request. Callers are expected to clean up the returned portFwd *exec.cmd after the port-forward is no longer needed.

func SelectJoinedData

func SelectJoinedData(message string, target *string, list []JoinerData) error

func UseStdio

func UseStdio(io terminal.Stdio)

Types

type JoinerData

type JoinerData interface {
	Join() string
	ID() string
}

type JoinerDataSlice

type JoinerDataSlice []JoinerData

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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