az

package
v1.23.14 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzAccountResponse

type AzAccountResponse struct {
	User AzAccountUser `json:"user"`
}

AzAccountResponse represents the structure of an Azure account response containing user information from the Azure CLI account output.

type AzAccountUser

type AzAccountUser struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

AzAccountUser represents a user account in Azure with basic identification details. It contains the user name and account type information as retrieved from Azure CLI.

type AzCli

type AzCli struct {
	// contains filtered or unexported fields
}

AzCli represents a wrapper around the Azure CLI command-line interface. It provides functionality to execute Azure CLI commands through a command runner.

func NewCli

func NewCli(
	commandRunner exec.CommandRunner,
) (AzCli, error)

NewCli creates a new AzCli instance with the provided command runner. The command runner is used to execute Azure CLI commands.

Parameters:

  • commandRunner: An implementation of exec.CommandRunner interface to execute commands

Returns:

  • AzCli: A new AzCli instance
  • error: An error if initialization fails, nil otherwise

func (AzCli) Account

func (az AzCli) Account(ctx context.Context) (AzAccountResponse, error)

Account retrieves the current Azure account information. It executes 'az account show' command and returns the account details in a structured format. If az CLI is not authenticated, it returns an error indicating authentication is required. Returns AzAccountResponse containing account details or an error if the operation fails.

func (AzCli) CheckInstalled

func (az AzCli) CheckInstalled() error

CheckInstalled checks if the Azure CLI ('az') is available in the system's PATH. It verifies whether the 'az' command can be found and executed from any directory. Returns nil if the Azure CLI is installed and accessible, or an error if not found.

Jump to

Keyboard shortcuts

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