Documentation
¶
Overview ¶
Package strict provides utilities used by Terragrunt to support a "strict" mode. By default strict mode is disabled, but when Enabled, any breaking changes to Terragrunt behavior that is not backwards compatible will result in an error.
Note that any behavior outlined here should be documented in /docs/_docs/04_reference/strict-mode.md
That is how users will know what to expect when they enable strict mode, and how to customize it.
Index ¶
- Constants
- type Categories
- func (categories Categories) FilterByNames(names ...string) Categories
- func (categories Categories) Find(name string) *Category
- func (categories Categories) Len() int
- func (categories Categories) Less(i, j int) bool
- func (categories Categories) Sort() Categories
- func (categories Categories) Swap(i, j int)
- type Category
- type Control
- type ControlNames
- type Controls
- func (ctrls Controls) AddSubcontrols(newCtrls ...Control)
- func (ctrls Controls) AddSubcontrolsToCategory(categoryName string, controls ...Control)
- func (ctrls Controls) Enable()
- func (ctrls Controls) EnableControl(name string) error
- func (ctrls Controls) Evaluate(ctx context.Context) error
- func (ctrls Controls) FilterByCategories(categories ...*Category) Controls
- func (ctrls Controls) FilterByEnabled() Controls
- func (ctrls Controls) FilterByNames(names ...string) Controls
- func (ctrls Controls) FilterByStatus(statuses ...Status) Controls
- func (ctrls Controls) Find(name string) Control
- func (ctrls Controls) GetCategories() Categories
- func (ctrls Controls) GetSubcontrols() Controls
- func (ctrls Controls) Len() int
- func (ctrls Controls) Less(i, j int) bool
- func (ctrls Controls) LogEnabled(logger log.Logger)
- func (ctrls Controls) Names() ControlNames
- func (ctrls Controls) RemoveDuplicates() Controls
- func (ctrls Controls) SetCategory(category *Category)
- func (ctrls Controls) Sort() Controls
- func (ctrls Controls) Swap(i, j int)
- type InvalidControlNameError
- type Status
- type Statuses
Constants ¶
const CompletedControlsFmt = "" /* 368-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Categories ¶ added in v0.73.0
type Categories []*Category
Categories is multiple of DeprecatedFlag Category.
func (Categories) FilterByNames ¶ added in v0.73.0
func (categories Categories) FilterByNames(names ...string) Categories
FilterByNames filters `categories` by the given `names`.
func (Categories) Find ¶ added in v0.73.0
func (categories Categories) Find(name string) *Category
Find search category by given `name`, returns nil if not found.
func (Categories) Len ¶ added in v0.73.0
func (categories Categories) Len() int
Len implements `sort.Interface` interface.
func (Categories) Less ¶ added in v0.73.0
func (categories Categories) Less(i, j int) bool
Less implements `sort.Interface` interface.
func (Categories) Sort ¶ added in v0.73.0
func (categories Categories) Sort() Categories
Sort returns `categories` in sorted order by `Name`.
func (Categories) Swap ¶ added in v0.73.0
func (categories Categories) Swap(i, j int)
Swap implements `sort.Interface` interface.
type Category ¶ added in v0.73.0
type Category struct { // Name is the name of the category. Name string // ShowStatus specifies whether to show or hide `Status`. ShowStatus bool // AllowedStatuses allows controls to be displayed only with the specified statuses. AllowedStatuses Statuses }
Category strict control category. Used to group controls when they are displayed.
type Control ¶
type Control interface { // GetName returns the name of the strict control. GetName() string // GetDescription returns the description of the strict control. GetDescription() string // GetStatus returns the status of the strict control. GetStatus() Status // Enable enables the control. Enable() // GetEnabled returns true if the control is enabled. GetEnabled() bool // GetCategory returns category of the strict control. GetCategory() *Category // SetCategory sets the category. SetCategory(category *Category) // GetSubcontrols returns all subcontrols. GetSubcontrols() Controls // AddSubcontrols adds the given `newCtrls` as subcontrols. AddSubcontrols(newCtrls ...Control) // Evaluate evaluates the struct control. Evaluate(ctx context.Context) error }
Control represents an interface that can be enabled or disabled in strict mode. When the Control is Enabled, Terragrunt will behave in a way that is not backwards compatible.
type ControlNames ¶ added in v0.73.0
type ControlNames []string
func (ControlNames) String ¶ added in v0.73.0
func (names ControlNames) String() string
type Controls ¶
type Controls []Control
Controls are multiple of Controls.
func (Controls) AddSubcontrols ¶ added in v0.73.0
AddSubcontrols adds the given `newCtrls` as subcontrols into all `ctrls`.
func (Controls) AddSubcontrolsToCategory ¶ added in v0.73.0
func (Controls) Enable ¶ added in v0.73.0
func (ctrls Controls) Enable()
Enable recursively enables all `ctrls`.
func (Controls) EnableControl ¶ added in v0.73.0
EnableControl validates that the specified control name is valid and enables `ctrl`.
func (Controls) Evaluate ¶ added in v0.73.0
Evaluate returns an error if the one of the controls is enabled otherwise logs warning messages and returns nil.
func (Controls) FilterByCategories ¶ added in v0.73.0
FilterByCategories filters `ctrls` by the given `categories`.
func (Controls) FilterByEnabled ¶ added in v0.73.0
FilterByEnabled filters `ctrls` by `Enabled: true` field.
func (Controls) FilterByNames ¶ added in v0.73.0
FilterByNames filters `ctrls` by the given `names`.
func (Controls) FilterByStatus ¶ added in v0.73.0
FilterByStatus filters `ctrls` by given statuses.
func (Controls) Find ¶ added in v0.73.0
Find search control by given `name`, returns nil if not found.
func (Controls) GetCategories ¶ added in v0.73.0
func (ctrls Controls) GetCategories() Categories
GetCategories returns a unique list of the `ctrls` categories.
func (Controls) GetSubcontrols ¶ added in v0.73.0
GetSubcontrols returns all subcontrols from all `ctrls`.
func (Controls) LogEnabled ¶ added in v0.73.0
LogEnabled logs the control names that are enabled and have completed Status.
func (Controls) Names ¶ added in v0.68.5
func (ctrls Controls) Names() ControlNames
Names returns names of all `ctrls`.
func (Controls) RemoveDuplicates ¶ added in v0.73.0
RemoveDuplicates removes controls with duplicate names.
func (Controls) SetCategory ¶ added in v0.73.0
SetCategory sets the given category for all `ctrls`.
type InvalidControlNameError ¶ added in v0.73.0
type InvalidControlNameError struct {
// contains filtered or unexported fields
}
InvalidControlNameError is an error that is returned when an invalid control name is requested.
func NewInvalidControlNameError ¶ added in v0.73.0
func NewInvalidControlNameError(allowedNames ControlNames) *InvalidControlNameError
func (InvalidControlNameError) Error ¶ added in v0.73.0
func (err InvalidControlNameError) Error() string
type Status ¶ added in v0.73.0
type Status byte
Status represetns the status of the Control.
const ( // ActiveStatus is the Status of a control that is ongoing. ActiveStatus Status = iota // CompletedStatus is the Status of a Control that is completed. CompletedStatus // SuspendedStatus is the Status of a Control that is suspended. // It does nothing and is assigned to a control only to avoid returning the `InvalidControlNameError`. SuspendedStatus )
Directories
¶
Path | Synopsis |
---|---|
Package controls contains strict controls.
|
Package controls contains strict controls. |
Package view contains the rendering logic for printing strict controls.
|
Package view contains the rendering logic for printing strict controls. |
plaintext
Package plaintext implements the view.Render interface for displaying strict controls in plaintext format.
|
Package plaintext implements the view.Render interface for displaying strict controls in plaintext format. |