cliutil

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

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 GetIngressHost added in v0.13.8

func GetIngressHost(proxyName, proxyNamespace, proxyPort string, localCluster bool, clusterName string) (string, error)

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)

Get the resource identified by the given URI. The URI can either be an 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 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