profile

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package profile provides interfaces and implementations for managing Azure profiles, including tenant and subscription management, configuration storage, and logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationAdapter

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

func NewConfigurationAdapter

func NewConfigurationAdapter(storage StorageAdapter, logger Logger) *ConfigurationAdapter

func (*ConfigurationAdapter) ClearContext

func (c *ConfigurationAdapter) ClearContext() error

ClearContext clears the default flag on every subscription, leaving the active config dir with no default subscription selected.

func (*ConfigurationAdapter) SelectWithFinder

func (c *ConfigurationAdapter) SelectWithFinder() (*types.Subscription, error)

func (*ConfigurationAdapter) SetContext

func (c *ConfigurationAdapter) SetContext(subscriptionID uuid.UUID) error

func (*ConfigurationAdapter) WithAliases added in v1.5.0

WithAliases attaches the user's configured subscription aliases, so the picker can show them.

type DefaultLogger

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

func NewLogger

func NewLogger(level string) *DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(msg string, args ...interface{})

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(msg string, args ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(msg string, args ...interface{})

func (*DefaultLogger) SetQuiet added in v1.4.0

func (l *DefaultLogger) SetQuiet(q bool) *DefaultLogger

SetQuiet suppresses Success messages (the context-switch confirmations) when q is true. It returns the logger so it can be chained onto NewLogger.

func (*DefaultLogger) Success

func (l *DefaultLogger) Success(msg string, args ...interface{})

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(msg string, args ...interface{})

type LogLevel

type LogLevel int
const (
	LevelDebug LogLevel = iota
	LevelInfo
	LevelWarn
	LevelError
)

type Logger

type Logger interface {
	// Info logs informational messages with optional formatting arguments.
	Info(msg string, args ...interface{})

	// Error logs error messages with optional formatting arguments.
	Error(msg string, args ...interface{})

	// Debug logs debug messages with optional formatting arguments.
	Debug(msg string, args ...interface{})

	// Warn logs warning messages with optional formatting arguments.
	Warn(msg string, args ...interface{})

	// Success logs success messages with optional formatting arguments.
	Success(msg string, args ...interface{})
}

Logger defines the interface for logging operations. It provides standard logging levels and formatting capabilities.

type StorageAdapter

type StorageAdapter interface {
	// ReadConfig retrieves the current Azure configuration.
	// Returns a Configuration object and any error encountered during the read operation.
	ReadConfig() (*types.Configuration, error)

	// WriteConfig persists the provided Azure configuration.
	// Returns an error if the write operation fails.
	WriteConfig(*types.Configuration) error
}

StorageAdapter defines the interface for configuration storage operations. Implementations of this interface handle reading and writing of Azure configuration data.

Jump to

Keyboard shortcuts

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