Documentation
¶
Overview ¶
Package controls contains strict controls.
Index ¶
- Constants
- func New() strict.Controls
- type Control
- func (ctrl *Control) AddSubcontrols(newCtrls ...strict.Control)
- func (ctrl *Control) Enable()
- func (ctrl *Control) Evaluate(ctx context.Context) error
- func (ctrl *Control) GetCategory() *strict.Category
- func (ctrl *Control) GetDescription() string
- func (ctrl *Control) GetEnabled() bool
- func (ctrl *Control) GetName() string
- func (ctrl *Control) GetStatus() strict.Status
- func (ctrl *Control) GetSubcontrols() strict.Controls
- func (ctrl *Control) SetCategory(category *strict.Category)
- func (ctrl *Control) String() string
- func (ctrl *Control) SuppressWarning()
- type DeprecatedEnvVar
- type DeprecatedFlagName
Constants ¶
const ( // DeprecatedCommands is the control that prevents the use of deprecated commands. DeprecatedCommands = "deprecated-commands" // DeprecatedFlags is the control that prevents the use of deprecated flag names. DeprecatedFlags = "deprecated-flags" // DeprecatedEnvVars is the control that prevents the use of deprecated env vars. DeprecatedEnvVars = "deprecated-env-vars" // DeprecatedConfigs is the control that prevents the use of deprecated config fields/section/..., anything related to config syntax. DeprecatedConfigs = "deprecated-configs" // LegacyAll is a control group for the legacy *-all commands. LegacyAll = "legacy-all" // LegacyLogs is a control group for legacy log flags that were in use before the log was redesign. LegacyLogs = "legacy-logs" // TerragruntPrefixFlags is a control group for flags that used to have the `terragrunt-` prefix. TerragruntPrefixFlags = "terragrunt-prefix-flags" // TerragruntPrefixEnvVars is a control group for env vars that used to have the `TERRAGRUNT_` prefix. TerragruntPrefixEnvVars = "terragrunt-prefix-env-vars" // DefaultCommands is a control group for TF commands that were used as default commands, // namely without using the parent `run` commands and were not shortcuts commands. DefaultCommands = "default-commands" // RootTerragruntHCL is the control that prevents usage of a `terragrunt.hcl` file as the root of Terragrunt configurations. RootTerragruntHCL = "root-terragrunt-hcl" // SkipDependenciesInputs is the control that prevents reading dependencies inputs and get performance boost. SkipDependenciesInputs = "skip-dependencies-inputs" // RequireExplicitBootstrap is the control that prevents the backend for remote state from being bootstrapped unless the `--backend-bootstrap` flag is specified. RequireExplicitBootstrap = "require-explicit-bootstrap" )
const ( DefaultCommandsCategoryName = "Default commands" RunAllCommandsCategoryName = "`*-all` commands" )
const ( GlobalEnvVarsCategoryName = "Global env vars" CommandEnvVarsCategoryNameFmt = "`%s` command env vars" )
const ( MovedGlobalFlagsCategoryNameFmt = "Global flags moved to `%s` command" GlobalFlagsCategoryName = "Global flags" CommandFlagsCategoryNameFmt = "`%s` command flags" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Control ¶
type Control struct {
// Error is the Error that will be returned when the Control is Enabled.
Error error
// Category is the category of the control.
Category *strict.Category
// Name is the name of the control.
Name string
// Description is the description of the control.
Description string
// Warning is a Warning that will be logged when the Control is not Enabled.
Warning string
// Subcontrols are child controls.
Subcontrols strict.Controls
// OnceWarn is used to prevent the warning message from being displayed multiple times.
OnceWarn sync.Once
// Status of the strict Control.
Status strict.Status
// Enabled indicates whether the control is enabled.
Enabled bool
// Suppress suppresses the warning message from being displayed.
Suppress bool
}
Control is the simplest implementation of the `strict.Control` interface.
func NewDeprecatedCommand ¶
NewDeprecatedCommand declares the deprecated command.
func (*Control) AddSubcontrols ¶
AddSubcontrols implements `strict.Control` interface.
func (*Control) Enable ¶
func (ctrl *Control) Enable()
Enable implements `strict.Control` interface.
func (*Control) GetCategory ¶
GetCategory implements `strict.Control` interface.
func (*Control) GetDescription ¶
GetDescription implements `strict.Control` interface.
func (*Control) GetEnabled ¶
GetEnabled implements `strict.Control` interface.
func (*Control) GetSubcontrols ¶
GetSubcontrols implements `strict.Control` interface.
func (*Control) SetCategory ¶
SetCategory implements `strict.Control` interface.
func (*Control) SuppressWarning ¶ added in v0.73.2
func (ctrl *Control) SuppressWarning()
SuppressWarning suppresses the warning message from being displayed.
type DeprecatedEnvVar ¶
type DeprecatedEnvVar struct {
*Control
ErrorFmt string
WarningFmt string
// contains filtered or unexported fields
}
DeprecatedEnvVar is strict control for deprecated environment variables.
func NewDeprecatedEnvVar ¶
func NewDeprecatedEnvVar(deprecatedFlag, newFlag cli.Flag, newValue string) *DeprecatedEnvVar
NewDeprecatedEnvVar returns a new `DeprecatedEnvVar` instance. Since we don't know which env vars can be used at the time of definition, we take the first env var from the list `GetEnvVars()` for the name and description to display it in `info strict`.
type DeprecatedFlagName ¶
type DeprecatedFlagName struct {
*Control
ErrorFmt string
WarningFmt string
// contains filtered or unexported fields
}
DeprecatedFlagName is strict control for deprecated flag names.
func NewDeprecatedFlagName ¶
func NewDeprecatedFlagName(deprecatedFlag, newFlag cli.Flag, newValue string) *DeprecatedFlagName
NewDeprecatedFlagName returns a new `DeprecatedFlagName` instance. Since we don't know which names can be used at the time of definition, we take the first name from the list `Names()` for the name and description to display it in `info strict`.
func NewDeprecatedMovedFlagName ¶
func NewDeprecatedMovedFlagName(deprecatedFlag, newFlag cli.Flag, commandName string) *DeprecatedFlagName