interactive

package
v1.2.45-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Mode       = "mode"
	ModeAuto   = "auto"
	ModeManual = "manual"
)

Variables

View Source
var MaxLength = func(length int) Validator {
	return Validator(survey.MaxLength(length))
}

Functions

func AddFlag

func AddFlag(flags *pflag.FlagSet)

AddFlag adds the interactive flag to the given set of command line flags.

func AddModeFlag added in v1.2.38

func AddModeFlag(cmd *cobra.Command)

func BuildAutomaticUpgradeSchedule added in v1.2.23

func BuildAutomaticUpgradeSchedule(cmd *cobra.Command, schedule string) (string, error)

func BuildManualUpgradeSchedule added in v1.2.23

func BuildManualUpgradeSchedule(cmd *cobra.Command, scheduleDate string, scheduleTime string) (time.Time, error)

func Enable

func Enable()

Enable enables the interactive mode

func Enabled

func Enabled() bool

Enabled returns a boolean flag that indicates if the interactive mode is enabled.

func GetAddonArgument added in v1.2.14

func GetAddonArgument(param cmv1.AddOnParameter, dflt string) (string, error)

func GetBool

func GetBool(input Input) (a bool, err error)

Asks for true/false value in the command line

func GetCert

func GetCert(input Input) (a string, err error)

Gets path to certificate file from the command line

func GetFloat added in v1.0.0

func GetFloat(input Input) (a float64, err error)

Gets float number input from the command line

func GetIPNet

func GetIPNet(input Input) (a net.IPNet, err error)

Asks for CIDR value in the command line

func GetInt

func GetInt(input Input) (a int, err error)

Gets int number input from the command line

func GetMode added in v1.2.38

func GetMode() (string, error)

func GetMultipleOptions

func GetMultipleOptions(input Input) ([]string, error)

Asks for multiple options selection

func GetOption

func GetOption(input Input) (a string, err error)

Asks for option selection in the command line

func GetOptionMode added in v1.2.38

func GetOptionMode(cmd *cobra.Command, mode string, question string) (string, error)

func GetPassword

func GetPassword(input Input) (a string, err error)

Gets password input from the command line

func GetString

func GetString(input Input) (a string, err error)

Gets string input from the command line

func IsCIDR added in v1.1.1

func IsCIDR(val interface{}) error

func IsCert added in v1.1.1

func IsCert(filepath interface{}) error

IsCert validates whether the given filepath is a valid cert file

func IsURL added in v1.1.1

func IsURL(val interface{}) error

IsURL validates whether the given value is a valid URL

func IsURLHttps added in v1.2.26

func IsURLHttps(val interface{}) error

func PrintHelp

func PrintHelp(help Help) error

func SetEnabled added in v1.2.40

func SetEnabled(setEnabled bool)

func SetModeKey added in v1.2.38

func SetModeKey(key string)

Types

type Help

type Help struct {
	Message string
	Steps   []string
}

type Input

type Input struct {
	Question   string
	Help       string
	Options    []string
	Default    interface{}
	Required   bool
	Validators []Validator
}

type Validator added in v1.1.1

type Validator survey.Validator

func AvailabilityZonesCountValidator added in v1.2.5

func AvailabilityZonesCountValidator(multiAZ bool) Validator

func MachinePoolRootDiskSizeValidator added in v1.2.26

func MachinePoolRootDiskSizeValidator(version string) Validator

func MaxValue added in v1.2.31

func MaxValue(max int) Validator

MaxValue returns a Validator that validates the entered number is less than or equal to max

func MinValue added in v1.2.31

func MinValue(min int) Validator

MinValue returns a validator that validates the entered number is greater than or equal to min

func NodePoolRootDiskSizeValidator added in v1.2.45

func NodePoolRootDiskSizeValidator() Validator

func RegExp added in v1.1.1

func RegExp(restr string) Validator

func RegExpBoolean added in v1.1.2

func RegExpBoolean(restr string) Validator

func SubnetsValidator added in v1.2.45

func SubnetsValidator(awsClient aws.Client, multiAZ bool, privateLink bool, hostedCP bool) Validator

SubnetsCountValidator get a slice of `[]core.OptionAnswer` as an interface. e.g. core.OptionAnswer { Value: subnet-04f67939f44a97dbe (us-west-2b), Index: 0 }

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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