cmd

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd implements the CobraCLI commands for the osintscan 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 OsintScan

type OsintScan struct {
	Version      string
	OutputConfig writer.OutputConfig
	OutputSignal signal.Signal
	RootFlags    config.RootFlags
	RootCmd      *cobra.Command
	VersionCmd   *cobra.Command
	DNSCmd       *cobra.Command
	ShodanCmd    *cobra.Command
}

OsintScan 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 NewOsintScan

func NewOsintScan(version string) *OsintScan

NewOsintScan creates a new OsintScan 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 (*OsintScan) InitDNSCommand

func (a *OsintScan) InitDNSCommand()

InitDNSCommand initializes the DNS command for the osintscan CLI that deals with gathering DNS records, certs, and subdomains.

func (*OsintScan) InitRootCommand

func (a *OsintScan) InitRootCommand()

InitRootCommand initializes the root command for the osintscan 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.

func (*OsintScan) InitShodanCommand

func (a *OsintScan) InitShodanCommand()

InitShodanCommand initializes the Shodan command for the osintscan CLI that deals with querying Shodan for information.

Jump to

Keyboard shortcuts

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