Documentation
¶
Overview ¶
Package cmd implements the CobraCLI commands for the infrascan 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 Infrascan ¶
type Infrascan struct {
Version string
OutputConfig writer.OutputConfig
OutputSignal signal.Signal
RootFlags config.RootFlags
RootCmd *cobra.Command
VersionCmd *cobra.Command
DNSCmd *cobra.Command
SaasCmd *cobra.Command
ShodanCmd *cobra.Command
}
Infrascan is the main struct for the CLI. It contains the version, output configuration, output signal, and root flags for the CLI. It also contains all commands and subcommands for the CLI. The output signal is used to write the output of the command to the desired output format after the execution of the invoked command's Run function.
func NewInfrascan ¶
NewInfrascan creates a new infrascan struct with the given version. It initializes the root command and all subcommands for 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 (*Infrascan) InitConnectCommand ¶ added in v0.0.4
func (a *Infrascan) InitConnectCommand()
func (*Infrascan) InitDiscoverCommand ¶
func (a *Infrascan) InitDiscoverCommand()
func (*Infrascan) InitRootCommand ¶
func (a *Infrascan) InitRootCommand()
InitRootCommand initializes the root command for the Infrascan CLI. This function initializes the root command with a PersistentPreRunE function that is responsible for setting the output configuration properly, as well as a PersistentPostRunE function that is responsible for writing the output signal to the desired output format.