Documentation ¶
Index ¶
- Variables
- func BoolValidate(bool string) error
- func BoolValidateOpt(inp *textinput.TextInput)
- func Complete(base CompletionBase, filters ...CompletionFilter) ...
- func FormatDuration(d time.Duration) string
- func FormatField(s string) string
- func FormatIntToSI(n uint64, decimals int) string
- func GetGroup(ctx context.Context, identifier string, nc rig.Client) (*group.Group, string, error)
- func GetUser(ctx context.Context, identifier string, nc rig.Client) (*user.User, string, error)
- func GetUserAndPasswordUpdates(username, email, phoneNumber, password string) ([]*user.Update, error)
- func GetUserIdentifier(username, email, phoneNumber string) (*model.UserIdentifier, error)
- func GetUserIdentifierUpdates(username, email, phoneNumber string) ([]*user.Update, error)
- func ParseUserIdentifier(identifier string) (*model.UserIdentifier, error)
- func ParseUserIdentifierUpdate(identifier string) (*user.Update, error)
- func PromptConfirm(label string, def bool) (bool, error)
- func PromptInput(label string, opts ...GetInputOption) (string, error)
- func PromptPassword(label string) (string, error)
- func PromptSelect(label string, choices []string, opts ...SelectInputOption) (int, string, error)
- func PromptTableSelect(label string, choices [][]string, columnHeaders []string, ...) (int, error)
- func PromptUserIndentifier() (*model.UserIdentifier, error)
- func PromptUserIndentifierUpdate() (*user.Update, error)
- func SelectDontShowResultOpt(s *selection.Selection[string])
- func SelectEnableFilterOpt(s *selection.Selection[string])
- func SelectFuzzyFilterOpt(s *selection.Selection[string])
- func ToStringWithSignificantDigits(f float64, digits int) string
- func ValidateAbsPathOpt(inp *textinput.TextInput)
- func ValidateAbsolutePath(input string) error
- func ValidateAll(_ string) error
- func ValidateAllOpt(inp *textinput.TextInput)
- func ValidateBool(s string) error
- func ValidateBoolOpt(inp *textinput.TextInput)
- func ValidateEmail(input string) error
- func ValidateEmailOpt(inp *textinput.TextInput)
- func ValidateFilePath(input string) error
- func ValidateFilePathOpt(inp *textinput.TextInput)
- func ValidateImage(input string) error
- func ValidateImageOpt(inp *textinput.TextInput)
- func ValidateInt(input string) error
- func ValidateIntInRange(minInclusive, maxInclusive int) func(string) error
- func ValidateIntOpt(inp *textinput.TextInput)
- func ValidateKubernetesName(input string) error
- func ValidateKubernetesNameOpt(inp *textinput.TextInput)
- func ValidateNonEmpty(input string) error
- func ValidateNonEmptyOpt(inp *textinput.TextInput)
- func ValidatePasswordOpt(inp *textinput.TextInput)
- func ValidatePhoneOpt(inp *textinput.TextInput)
- func ValidatePort(s string) error
- func ValidatePortOpt(inp *textinput.TextInput)
- func ValidateQuantity(s string) error
- func ValidateQuantityOpt(inp *textinput.TextInput)
- func ValidateSystemName(input string) error
- func ValidateSystemNameOpt(inp *textinput.TextInput)
- func ValidateURL(input string) error
- func ValidateURLOpt(inp *textinput.TextInput)
- func ValidateUnique(values []string) func(string) error
- type CompletionBase
- type CompletionFilter
- type DeferredOutputCommand
- func (d *DeferredOutputCommand) Command(cmd string, args ...string) *DeferredOutputCommand
- func (d *DeferredOutputCommand) End(successful bool)
- func (d *DeferredOutputCommand) Output() ([]byte, error)
- func (d *DeferredOutputCommand) Run() error
- func (d *DeferredOutputCommand) RunNew(cmd string, args ...string) error
- func (d *DeferredOutputCommand) Start() error
- func (d *DeferredOutputCommand) StdinPipe() (io.WriteCloser, error)
- func (d *DeferredOutputCommand) Wait() error
- type GetInputOption
- type SelectInputOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ArgsCompletionFilter = func( cmd *cobra.Command, args []string, toComplete string, completions []string, directive cobra.ShellCompDirective, ) ([]string, cobra.ShellCompDirective) { args = append(args, toComplete) err := cmd.Args(cmd, args) if err != nil { fmt.Println(err.Error()) return []string{}, cobra.ShellCompDirectiveError } return completions, directive }
View Source
var BoolCompletions = func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { return []string{"true", "false"}, cobra.ShellCompDirectiveDefault }
Functions ¶
func BoolValidate ¶
func BoolValidateOpt ¶ added in v1.1.3
func Complete ¶ added in v1.2.0
func Complete( base CompletionBase, filters ...CompletionFilter, ) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
Complete is a helper function to chain a completion function and subsequent filters.
func FormatDuration ¶ added in v1.2.0
func FormatField ¶
func FormatIntToSI ¶ added in v1.1.3
func GetUserIdentifier ¶
func GetUserIdentifier(username, email, phoneNumber string) (*model.UserIdentifier, error)
func ParseUserIdentifier ¶
func ParseUserIdentifier(identifier string) (*model.UserIdentifier, error)
func PromptInput ¶ added in v1.1.3
func PromptInput(label string, opts ...GetInputOption) (string, error)
func PromptPassword ¶ added in v1.1.3
func PromptSelect ¶
func PromptTableSelect ¶ added in v1.2.0
func PromptUserIndentifier ¶
func PromptUserIndentifier() (*model.UserIdentifier, error)
func SelectDontShowResultOpt ¶ added in v1.4.0
func SelectEnableFilterOpt ¶ added in v1.2.0
func SelectFuzzyFilterOpt ¶ added in v1.2.0
func ToStringWithSignificantDigits ¶ added in v1.1.3
func ValidateAbsPathOpt ¶ added in v1.1.3
func ValidateAbsolutePath ¶ added in v1.1.3
func ValidateAll ¶
func ValidateAllOpt ¶ added in v1.1.3
func ValidateBool ¶ added in v1.1.3
func ValidateBoolOpt ¶ added in v1.1.3
func ValidateEmail ¶
func ValidateEmailOpt ¶ added in v1.1.3
func ValidateFilePath ¶ added in v1.2.0
func ValidateFilePathOpt ¶ added in v1.2.0
func ValidateImage ¶
func ValidateImageOpt ¶ added in v1.1.3
func ValidateInt ¶
func ValidateIntInRange ¶ added in v1.5.1
func ValidateIntOpt ¶ added in v1.1.3
func ValidateKubernetesName ¶ added in v1.5.1
func ValidateKubernetesNameOpt ¶ added in v1.5.1
func ValidateNonEmpty ¶
func ValidateNonEmptyOpt ¶ added in v1.1.3
func ValidatePasswordOpt ¶ added in v1.1.3
func ValidatePhoneOpt ¶ added in v1.1.3
func ValidatePort ¶ added in v1.4.0
func ValidatePortOpt ¶ added in v1.4.0
func ValidateQuantity ¶ added in v1.1.3
func ValidateQuantityOpt ¶ added in v1.1.3
func ValidateSystemName ¶
func ValidateSystemNameOpt ¶ added in v1.1.3
func ValidateURL ¶
func ValidateURLOpt ¶ added in v1.1.3
func ValidateUnique ¶ added in v1.4.0
Types ¶
type CompletionBase ¶ added in v1.5.0
type CompletionFilter ¶ added in v1.5.0
type CompletionFilter func( cmd *cobra.Command, args []string, toComplete string, current []string, directive cobra.ShellCompDirective, ) ([]string, cobra.ShellCompDirective)
func MaxArgsCompletionFilter ¶ added in v1.2.0
func MaxArgsCompletionFilter(max int) CompletionFilter
type DeferredOutputCommand ¶ added in v1.5.0
type DeferredOutputCommand struct {
// contains filtered or unexported fields
}
func NewDefferredOutputCommand ¶ added in v1.5.0
func NewDefferredOutputCommand(displayMessage string) *DeferredOutputCommand
func (*DeferredOutputCommand) Command ¶ added in v1.5.0
func (d *DeferredOutputCommand) Command(cmd string, args ...string) *DeferredOutputCommand
func (*DeferredOutputCommand) End ¶ added in v1.5.0
func (d *DeferredOutputCommand) End(successful bool)
func (*DeferredOutputCommand) Output ¶ added in v1.5.0
func (d *DeferredOutputCommand) Output() ([]byte, error)
func (*DeferredOutputCommand) Run ¶ added in v1.5.0
func (d *DeferredOutputCommand) Run() error
func (*DeferredOutputCommand) RunNew ¶ added in v1.5.0
func (d *DeferredOutputCommand) RunNew(cmd string, args ...string) error
func (*DeferredOutputCommand) Start ¶ added in v1.5.0
func (d *DeferredOutputCommand) Start() error
func (*DeferredOutputCommand) StdinPipe ¶ added in v1.5.0
func (d *DeferredOutputCommand) StdinPipe() (io.WriteCloser, error)
func (*DeferredOutputCommand) Wait ¶ added in v1.5.0
func (d *DeferredOutputCommand) Wait() error
type GetInputOption ¶ added in v1.1.3
func InputDefaultOpt ¶ added in v1.1.3
func InputDefaultOpt(def string) GetInputOption
func ValidateAndOpt ¶ added in v1.4.0
func ValidateAndOpt(validators ...func(string) error) GetInputOption
func ValidateIntInRangeOpt ¶ added in v1.5.1
func ValidateIntInRangeOpt(minInclusive, maxInclusive int) GetInputOption
func ValidateUniqueOpt ¶ added in v1.4.0
func ValidateUniqueOpt(values []string) GetInputOption
type SelectInputOption ¶ added in v1.2.0
TODO What about non-string Selection
func SelectExtendTemplateOpt ¶ added in v1.2.0
func SelectExtendTemplateOpt(t template.FuncMap) SelectInputOption
func SelectTemplateOpt ¶ added in v1.2.0
func SelectTemplateOpt(template string) SelectInputOption
Click to show internal directories.
Click to hide internal directories.