Documentation
¶
Overview ¶
Package cmd implements the CobraCLI commands for the identityvalidate CLI. Subcommands for the CLI should all live within this package. Logic should be delegated to internal packages and functions to keep the CLI commands clean and focused on CLI I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdentityValidate ¶
type IdentityValidate struct { Version string RootFlags config.RootFlags OutputConfig writer.OutputConfig OutputSignal signal.Signal RootCmd *cobra.Command }
IdentityValidate is the main struct that holds the root command and all subcommands that are used throughout execution of the CLI. It is also responsible for holding the Output configuration, and Output signal for use by subcommands. The output signal is used to write the output of the command to the desired output format after the execution of the invoked commands Run function.
func Newidentityvalidate ¶
func Newidentityvalidate(version string) *IdentityValidate
Newidentityvalidate returns a new identityvalidate struct with the provided version string. The identityvalidate struct is used to initialize the root command and all subcommands that are used throughout execution of the CLI. We pass the version command in here from the main.go file, where we set the version string during the build process.
func (*IdentityValidate) InitPortalCommand ¶
func (a *IdentityValidate) InitPortalCommand()
func (*IdentityValidate) InitRootCommand ¶
func (a *IdentityValidate) InitRootCommand()
InitRootCommand initializes the root command for the identityvalidate CLI. This command is used to set the global flags that are used by all subcommands, such as the output format, and output file. It also initializes the version command that prints the version of the CLI. Critically, this sets the PersistentPreRunE and PersistentPostRunE functions that are inherited by most subcommands. The PersistentPostRunE function is used to write the output of the command to the desired output format after the execution of the invoked command's Run function.