validation

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identifier

type Identifier struct {
	Flag  string
	Value string
}

Struct to model the instance identifier provided by the user (either instance-id or display-name)

func GetValidatedInstanceIdentifier

func GetValidatedInstanceIdentifier(p *print.Printer, cmd *cobra.Command) (*Identifier, error)

GetValidatedInstanceIdentifier gets and validates the instance identifier provided by the user through the command-line flags. It checks for either an instance ID or a display name and validates the provided value.

p is the printer used for logging. cmd is the cobra command that holds the flags.

Returns an Identifier struct containing the flag and its value if a valid identifier is provided, otherwise returns an error. Indirect unit tests of GetValidatedInstanceIdentifier are done within the respective CLI packages.

Jump to

Keyboard shortcuts

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