cmd

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package cmd implements the CobraCLI commands for the methodazure 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 MethodAzure

type MethodAzure struct {
	Version      string
	RootFlags    config.RootFlags
	AzureConfig  config.AzureConfig
	OutputConfig writer.OutputConfig
	OutputSignal signal.Signal
	RootCmd      *cobra.Command
	VersionCmd   *cobra.Command
}

MethodAzure is the main struct for the methodazure CLI. It contains all the necessary fields to run the CLI, including all subcommands. It is also responsible for holding the Azure configuration, 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 NewMethodAzure

func NewMethodAzure(version string) *MethodAzure

NewMethodAzure returns a new MethodAzure struct with the provided version string. The MethodAzure 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 (*MethodAzure) InitAKSCommand

func (a *MethodAzure) InitAKSCommand()

InitAKSCommand initializes the `methodazure aks` subcommand that deals with enumerating AKS clusters in the Azure environment.

func (*MethodAzure) InitDNSCommand

func (a *MethodAzure) InitDNSCommand()

InitDNSCommand initializes the `methodazure dns` subcommand that deals with enumerating DNS related resources in the Azure environment.

func (*MethodAzure) InitDatabaseCommand

func (a *MethodAzure) InitDatabaseCommand()

InitDatabaseCommand initializes the `methodazure database` subcommand that deals with enumerating managed Database instances in the Azure environment.

func (*MethodAzure) InitEntraCommand added in v0.0.3

func (a *MethodAzure) InitEntraCommand()

InitEntraCommand initializes the `methodazure entra` subcommand that deals with enumerating Entra related resources in the Azure environment.

func (*MethodAzure) InitIAMCommand added in v0.0.3

func (a *MethodAzure) InitIAMCommand()

InitIAMCommand initializes the `methodazure iam` subcommand that deals with enumerating IAM related resources in the Azure environment.

func (*MethodAzure) InitLoadBalancerCommand added in v0.0.11

func (a *MethodAzure) InitLoadBalancerCommand()

InitLoadBalancerCommand initializes the `methodazure loadbalancer` subcommand that deals with enumerating Load Balanccers in the Azure environment.

func (*MethodAzure) InitNSGCommand

func (a *MethodAzure) InitNSGCommand()

InitNSGCommand initializes the `methodazure nsg` subcommand that deals with enumerating Network Security Groups in the Azure environment.

func (*MethodAzure) InitResourceGroupCommand

func (a *MethodAzure) InitResourceGroupCommand()

InitResourceGroupCommand initializes the `methodazure resourcegroup` subcommand that deals with enumerating Resource Groups in the Azure environment.

func (*MethodAzure) InitRootCommand

func (a *MethodAzure) InitRootCommand()

InitRootCommand initializes the root command for the methodazure CLI. This command is used to set the global flags that are used by all subcommands, such as the region, 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 all subcommands. The PersistentPreRunE function is used to validate the region flag and set the AWS configuration. 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.

func (*MethodAzure) InitStorageAccountCommand

func (a *MethodAzure) InitStorageAccountCommand()

InitStorageAccountCommand initializes the `methodazure storage` subcommand that deals with enumerating Storage Accounts in the Azure environment.

func (*MethodAzure) InitSubscriptionCommand added in v0.0.3

func (a *MethodAzure) InitSubscriptionCommand()

InitSubscriptionCommand initializes the `methodazure subscription` subcommand that deals with enumerating Azure Subscription related details.

func (*MethodAzure) InitTenantCommand added in v0.0.3

func (a *MethodAzure) InitTenantCommand()

InitTenantCommand initializes the `methodazure tenant` subcommand that deals with enumerating Azure Tenant related details.

func (*MethodAzure) InitVMCommand

func (a *MethodAzure) InitVMCommand()

InitVMCommand initializes the `methodazure vm` subcommand that deals with enumerating Virtual Machines in the Azure environment.

func (*MethodAzure) InitVNetCommand

func (a *MethodAzure) InitVNetCommand()

InitVNetCommand initializes the `methodazure vnet` subcommand that deals with enumerating VNets in the Azure environment.

Jump to

Keyboard shortcuts

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