internal

package
v0.0.0-...-503a260 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VsCodeAgentPrefix = "vscode:/extensions/ms-azuretools.azure-dev"
	// cspell: disable-next-line
	VsAgentPrefix = "vside:/webtools/azdev.publish"
)

Well-known user agents prefixes.

View Source
const AzdUserAgentEnvVar = "AZURE_DEV_USER_AGENT"

Environment variable that identifies a user agent calling into azd. Any caller of azd can set this variable to identify themselves.

View Source
const EnvironmentNameFlagName string = "environment"

EnvironmentNameFlagName is the full name of the flag as it appears on the command line.

Variables

View Source
var Version = cDevVersionString

The version string, as printed by `azd version`.

This MUST be of the form "<semver> (commit <full commit hash>)"

The default value here is used for a version built directly by a developer when running either `go install` or `go build` without overriding the value at link time (the default behavior when build or install are run without arguments).

Official builds set this value based on the version and commit we are building, using `-ldflags`

Example:

-ldflags="-X 'github.com/azure/azure-dev/cli/azd/internal.Version=0.0.1-alpha.1 (commit 8a49ae5ae9ab13beeade35f91ad4b4611c2f5574)'"

This value is exported and not const so it can be mutated by certain tests. Instead of accessing this member directly, use VersionInfo which returns a structured version of this value.

nolint: lll

Functions

func IsDevVersion

func IsDevVersion() bool

func IsNonProdVersion

func IsNonProdVersion() bool

func UserAgent

func UserAgent() string

UserAgent() creates the user agent string for azd.

Examples:

  • azdev/1.0.0 (Go 1.18; windows/amd64)
  • azdev/1.0.0 (Go 1.18; windows/amd64) azd-caller/1.0.0

Types

type AzdVersionInfo

type AzdVersionInfo struct {
	Version semver.Version
	Commit  string
}

func VersionInfo

func VersionInfo() AzdVersionInfo

type EnvFlag

type EnvFlag struct {
	EnvironmentName string
}

EnvFlag is a flag that represents the environment name. Actions which inject an environment should also use this flag so the user can control what environment is loaded in a uniform way across all our commands.

func (*EnvFlag) Bind

func (e *EnvFlag) Bind(local *pflag.FlagSet, global *GlobalCommandOptions)

type ErrorWithSuggestion

type ErrorWithSuggestion struct {
	Suggestion string
	Err        error
}

ErrorWithSuggestion is a custom error type that includes a suggestion for the user

func (*ErrorWithSuggestion) Error

func (es *ErrorWithSuggestion) Error() string

Error returns the error message

func (*ErrorWithSuggestion) Unwrap

func (es *ErrorWithSuggestion) Unwrap() error

Unwrap returns the wrapped error

type ErrorWithTraceId

type ErrorWithTraceId struct {
	TraceId string
	Err     error
}

ErrorWithTraceId is a custom error type that includes a trace ID for the current operation

func (*ErrorWithTraceId) Error

func (et *ErrorWithTraceId) Error() string

Error returns the error message

func (*ErrorWithTraceId) Unwrap

func (et *ErrorWithTraceId) Unwrap() error

Unwrap returns the wrapped error

type GlobalCommandOptions

type GlobalCommandOptions struct {
	// Cwd allows the user to override the current working directory, temporarily.
	// The root command will take care of cd'ing into that folder before your command
	// and cd'ing back to the original folder after the commands complete (to make testing
	// easier)
	Cwd string

	// EnableDebugLogging indicates you should turn on verbose/debug logging in your command any
	// launched tools. It's enabled with `--debug`, for any command.
	EnableDebugLogging bool

	// when true, interactive prompts should behave as if the user selected the default value.
	// if there is no default value the prompt returns an error.
	NoPrompt bool

	// EnableTelemetry indicates if telemetry should be sent.
	// The rootCmd will disable this based if the environment variable
	// AZURE_DEV_COLLECT_TELEMETRY is set to 'no'.
	// Defaults to true.
	EnableTelemetry bool

	// Generates platform-agnostic help for use on static documentation sites
	// like learn.microsoft.com. This is set directly when calling NewRootCmd
	// and not bound to any command flags.
	GenerateStaticHelp bool
}

Directories

Path Synopsis
Package appdetect allows for detection of application projects.
Package appdetect allows for detection of application projects.
Package repository provides handling of files in the user's code repository.
Package repository provides handling of files in the user's code repository.
Package telemetry provides functionality for emitting telemetry in azd.
Package telemetry provides functionality for emitting telemetry in azd.
baggage
Package baggage provides an implementation of storing trace-level context data, i.e.
Package baggage provides an implementation of storing trace-level context data, i.e.
events
Package events provides definitions and functions related to the definition of telemetry events.
Package events provides definitions and functions related to the definition of telemetry events.
fields
Package fields provides definitions and functions related to the definition of telemetry fields.
Package fields provides definitions and functions related to the definition of telemetry fields.
resource
Package resource provides application-level resource attributes for telemetry purposes.
Package resource provides application-level resource attributes for telemetry purposes.
Package vsrpc provides the RPC server that Visual Studio uses to interact with azd programmatically.
Package vsrpc provides the RPC server that Visual Studio uses to interact with azd programmatically.

Jump to

Keyboard shortcuts

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