experiment

package
v0.71.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package experiment provides utilities used by Terragrunt to support an "experiment" mode. By default experiment mode is disabled, but when enabled, experimental features can be enabled. These features are not yet stable and may change in the future.

Note that any behavior outlined here should be documented in /docs/_docs/04_reference/experiment-mode.md

That is how users will know what to expect when they enable experiment mode, and how to customize it.

Index

Constants

View Source
const (
	// StatusOngoing is the status of an experiment that is ongoing.
	StatusOngoing = iota
	// StatusCompleted is the status of an experiment that is completed.
	StatusCompleted
)
View Source
const (
	// Symlinks is the experiment that allows symlinks to be used in Terragrunt configurations.
	Symlinks = "symlinks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedExperimentsWarning

type CompletedExperimentsWarning struct {
	ExperimentNames []string
}

CompletedExperimentsWarning is a warning that is returned when completed experiments are requested.

func (CompletedExperimentsWarning) String

type Experiment

type Experiment struct {
	// Enabled determines if the experiment is enabled.
	Enabled bool
	// Name is the name of the experiment.
	Name string
	// Status is the status of the experiment.
	Status int
}

Experiment represents an experiment that can be enabled. When the experiment is enabled, Terragrunt will behave in a way that uses some experimental functionality.

func (Experiment) Evaluate

func (e Experiment) Evaluate(experimentMode bool) bool

Evaluate returns true if either the experiment is enabled, or experiment mode is enabled.

func (Experiment) String

func (e Experiment) String() string

type Experiments

type Experiments map[string]Experiment

func NewExperiments

func NewExperiments() Experiments

NewExperiments returns a new Experiments map with all experiments disabled.

Bottom values for each experiment are the defaults, so only the names of experiments need to be set.

func (*Experiments) EnableExperiments

func (e *Experiments) EnableExperiments(experimentNames []string) error

EnableExperiments enables the given experiments.

func (*Experiments) ValidateExperimentNames

func (e *Experiments) ValidateExperimentNames(experimentNames []string) (string, error)

ValidateExperimentNames validates the given slice of experiment names are valid.

type InvalidExperimentsError

type InvalidExperimentsError struct {
	ExperimentNames []string
}

InvalidExperimentsError is an error that is returned when an invalid experiments are requested.

func (InvalidExperimentsError) Error

func (e InvalidExperimentsError) Error() string

Jump to

Keyboard shortcuts

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