Documentation
¶
Index ¶
- Variables
- func IsChildAction(ctx context.Context) bool
- func WithChildAction(ctx context.Context) context.Context
- type CurrentUserAuthManager
- type DebugMiddleware
- type ErrorMiddleware
- type ExperimentationMiddleware
- type ExtensionsMiddleware
- type HooksMiddleware
- type LoginGuardMiddleware
- type Middleware
- func NewDebugMiddleware(options *Options, console input.Console) Middleware
- func NewErrorMiddleware(options *Options, console input.Console, agentFactory agent.AgentFactory, ...) Middleware
- func NewExperimentationMiddleware() Middleware
- func NewExtensionsMiddleware(options *Options, serviceLocator ioc.ServiceLocator, ...) Middleware
- func NewHooksMiddleware(envManager environment.Manager, env *environment.Environment, ...) Middleware
- func NewLoginGuardMiddleware(console input.Console, authManager CurrentUserAuthManager, ...) Middleware
- func NewTelemetryMiddleware(options *Options, lazyPlatformConfig *lazy.Lazy[*platform.Config], ...) Middleware
- func NewToolFirstRunMiddleware(alphaManager *alpha.FeatureManager, configManager config.UserConfigManager, ...) Middleware
- func NewToolUpdateCheckMiddleware(alphaManager *alpha.FeatureManager, manager *tool.Manager, ...) Middleware
- func NewUxMiddleware(options *Options, console input.Console, featuresManager *alpha.FeatureManager) Middleware
- type MiddlewareRunner
- type NextFn
- type Options
- type ResolveFn
- type TelemetryMiddleware
- type ToolFirstRunMiddleware
- type ToolUpdateCheckMiddleware
- type UxMiddleware
Constants ¶
This section is empty.
Variables ¶
var ErrDebuggerAborted = errors.New("debugger attach aborted")
ErrDebuggerAborted is returned when the user declines to attach a debugger.
Functions ¶
func IsChildAction ¶
IsChildAction checks if the given context was created by WithChildAction. This is used to determine if a command is being executed as part of a workflow step.
Types ¶
type CurrentUserAuthManager ¶
type CurrentUserAuthManager interface {
Cloud() *cloud.Cloud
Mode() (auth.AuthSource, error)
CredentialForCurrentUser(
ctx context.Context,
options *auth.CredentialForCurrentUserOptions,
) (azcore.TokenCredential, error)
}
type DebugMiddleware ¶
type DebugMiddleware struct {
// contains filtered or unexported fields
}
Adds support to easily debug and attach a debugger to AZD for development purposes
func (*DebugMiddleware) Run ¶
func (m *DebugMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
Invokes the debug middleware. When AZD_DEBUG is set will prompt the user to attach a debugger before continuing invocation of the action
type ErrorMiddleware ¶
type ErrorMiddleware struct {
// contains filtered or unexported fields
}
func (*ErrorMiddleware) Run ¶
func (e *ErrorMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
type ExperimentationMiddleware ¶
type ExperimentationMiddleware struct {
}
func (*ExperimentationMiddleware) Run ¶
func (m *ExperimentationMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
type ExtensionsMiddleware ¶
type ExtensionsMiddleware struct {
// contains filtered or unexported fields
}
func (*ExtensionsMiddleware) Run ¶
func (m *ExtensionsMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
type HooksMiddleware ¶
type HooksMiddleware struct {
// contains filtered or unexported fields
}
func (*HooksMiddleware) Run ¶
func (m *HooksMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
Runs the Hooks middleware
type LoginGuardMiddleware ¶
type LoginGuardMiddleware struct {
// contains filtered or unexported fields
}
LoginGuardMiddleware ensures that the user is logged in otherwise it returns an error
func (*LoginGuardMiddleware) Run ¶
func (l *LoginGuardMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
Run ensures that the user is logged in otherwise it returns an error
type Middleware ¶
type Middleware interface {
Run(ctx context.Context, nextFn NextFn) (*actions.ActionResult, error)
}
Defines a middleware component
func NewDebugMiddleware ¶
func NewDebugMiddleware(options *Options, console input.Console) Middleware
Creates a new instance of the Debug middleware
func NewErrorMiddleware ¶
func NewErrorMiddleware( options *Options, console input.Console, agentFactory agent.AgentFactory, global *internal.GlobalCommandOptions, featuresManager *alpha.FeatureManager, userConfigManager config.UserConfigManager, errorPipeline *errorhandler.ErrorHandlerPipeline, ) Middleware
func NewExperimentationMiddleware ¶
func NewExperimentationMiddleware() Middleware
func NewExtensionsMiddleware ¶
func NewExtensionsMiddleware( options *Options, serviceLocator ioc.ServiceLocator, extensionsManager *extensions.Manager, extensionRunner *extensions.Runner, console input.Console, globalOptions *internal.GlobalCommandOptions, ) Middleware
func NewHooksMiddleware ¶
func NewHooksMiddleware( envManager environment.Manager, env *environment.Environment, projectConfig *project.ProjectConfig, importManager *project.ImportManager, commandRunner exec.CommandRunner, console input.Console, options *Options, serviceLocator ioc.ServiceLocator, ) Middleware
Creates a new instance of the Hooks middleware
func NewLoginGuardMiddleware ¶
func NewLoginGuardMiddleware( console input.Console, authManager CurrentUserAuthManager, workflowRunner *workflow.Runner) Middleware
NewLoginGuardMiddleware creates a new instance of the LoginGuardMiddleware
func NewTelemetryMiddleware ¶
func NewTelemetryMiddleware( options *Options, lazyPlatformConfig *lazy.Lazy[*platform.Config], extensionManager *extensions.Manager, ) Middleware
Creates a new Telemetry middleware instance
func NewToolFirstRunMiddleware ¶ added in v1.25.0
func NewToolFirstRunMiddleware( alphaManager *alpha.FeatureManager, configManager config.UserConfigManager, console input.Console, manager *tool.Manager, options *internal.GlobalCommandOptions, ) Middleware
NewToolFirstRunMiddleware creates a new ToolFirstRunMiddleware.
func NewToolUpdateCheckMiddleware ¶ added in v1.25.0
func NewToolUpdateCheckMiddleware( alphaManager *alpha.FeatureManager, manager *tool.Manager, console input.Console, options *Options, globalOptions *internal.GlobalCommandOptions, ) Middleware
NewToolUpdateCheckMiddleware creates a new ToolUpdateCheckMiddleware. All dependencies are resolved by the IoC container.
func NewUxMiddleware ¶
func NewUxMiddleware(options *Options, console input.Console, featuresManager *alpha.FeatureManager) Middleware
type MiddlewareRunner ¶
type MiddlewareRunner struct {
// contains filtered or unexported fields
}
Middleware runner stores middleware registrations and orchestrates the invocation of middleware components and actions.
func NewMiddlewareRunner ¶
func NewMiddlewareRunner(container *ioc.NestedContainer) *MiddlewareRunner
Creates a new middleware runner
func (*MiddlewareRunner) RunAction ¶
func (r *MiddlewareRunner) RunAction( ctx context.Context, runOptions *Options, actionName string, ) (*actions.ActionResult, error)
Executes the middleware chain for the specified action
type NextFn ¶
type NextFn func(ctx context.Context) (*actions.ActionResult, error)
Executes the next middleware in the command chain
type Options ¶
type Options struct {
CommandPath string
Name string
Aliases []string
Flags *pflag.FlagSet
Args []string
Annotations map[string]string
// contains filtered or unexported fields
}
Middleware Run options
func (*Options) WithContainer ¶
func (o *Options) WithContainer(container *ioc.NestedContainer)
Sets the container to be used for resolving middleware components
type ResolveFn ¶
type ResolveFn func() Middleware
Registration function that returns a constructed middleware
type TelemetryMiddleware ¶
type TelemetryMiddleware struct {
// contains filtered or unexported fields
}
Telemetry middleware tracks telemetry for the given action
func (*TelemetryMiddleware) Run ¶
func (m *TelemetryMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)
Invokes the middleware and wraps the action with a telemetry span for telemetry reporting
type ToolFirstRunMiddleware ¶ added in v1.25.0
type ToolFirstRunMiddleware struct {
// contains filtered or unexported fields
}
ToolFirstRunMiddleware presents a one-time welcome experience on the very first invocation of azd. It detects the user's installed Azure development tools and optionally offers to install any missing recommended tools.
func (*ToolFirstRunMiddleware) Run ¶ added in v1.25.0
func (m *ToolFirstRunMiddleware) Run(ctx context.Context, nextFn NextFn) (*actions.ActionResult, error)
Run executes the first-run experience if it has not been completed yet. Regardless of whether the experience runs, the middleware always delegates to nextFn so the user's intended command is never blocked.
type ToolUpdateCheckMiddleware ¶ added in v1.25.0
type ToolUpdateCheckMiddleware struct {
// contains filtered or unexported fields
}
ToolUpdateCheckMiddleware periodically checks for tool updates in the background and displays cached update notifications before command execution. Notifications are only shown when the console is interactive and the current command is not a tool-management subcommand.
func (*ToolUpdateCheckMiddleware) Run ¶ added in v1.25.0
func (m *ToolUpdateCheckMiddleware) Run(ctx context.Context, nextFn NextFn) (*actions.ActionResult, error)
Run executes the tool update check middleware. Before the command runs it displays any cached update notifications. After the command completes it triggers a background update check when the configured check interval has elapsed.
type UxMiddleware ¶
type UxMiddleware struct {
// contains filtered or unexported fields
}
func (*UxMiddleware) Run ¶
func (m *UxMiddleware) Run(ctx context.Context, next NextFn) (*actions.ActionResult, error)