cliutil

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: Apache-2.0 Imports: 10 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 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 GetStringSliceInput

func GetStringSliceInput(msg 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 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