Documentation
¶
Overview ¶
Package variables contains functions for interacting with variables
Deprecated: Only supported by deprecated v1alpha1 packages.
Package variables contains functions for interacting with variables ¶
Package variables contains functions for interacting with variables
Index ¶
- type SetVariable
- type SetVariableMap
- type TextTemplate
- type VariableConfig
- func (vc *VariableConfig) CheckVariablePattern(name, pattern string) errordeprecated
- func (vc *VariableConfig) GetAllTemplates() map[string]*TextTemplatedeprecated
- func (vc *VariableConfig) GetConstants() []api.Constantdeprecated
- func (vc *VariableConfig) GetSetVariable(name string) (*SetVariable, bool)deprecated
- func (vc *VariableConfig) GetSetVariableMap() SetVariableMapdeprecated
- func (vc *VariableConfig) PopulateVariables(variables []api.InteractiveVariable, presetVariables map[string]string) errordeprecated
- func (vc *VariableConfig) ReplaceTextTemplate(path string) (err error)deprecated
- func (vc *VariableConfig) SetApplicationTemplates(applicationTemplates map[string]*TextTemplate)deprecated
- func (vc *VariableConfig) SetConstants(constants []api.Constant)deprecated
- func (vc *VariableConfig) SetVariable(name, value string, sensitive bool, autoIndent bool, varType api.VariableType)deprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetVariable ¶
SetVariable is the runtime value of a package variable.
type SetVariableMap ¶
type SetVariableMap map[string]*SetVariable
SetVariableMap represents a map of variable names to their set values
type TextTemplate ¶
type TextTemplate struct {
Sensitive bool
AutoIndent bool
Type api.VariableType
Value string
}
TextTemplate represents a value to be templated into a text file.
type VariableConfig ¶
type VariableConfig struct {
// contains filtered or unexported fields
}
VariableConfig represents a value to be templated into a text file.
func New
deprecated
func New(templatePrefix string, prompt func(variable api.InteractiveVariable) (value string, err error), logger *slog.Logger) *VariableConfig
New creates a new VariableConfig
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) CheckVariablePattern
deprecated
func (vc *VariableConfig) CheckVariablePattern(name, pattern string) error
CheckVariablePattern checks to see if a current variable is set to a value that matches its pattern
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) GetAllTemplates
deprecated
func (vc *VariableConfig) GetAllTemplates() map[string]*TextTemplate
GetAllTemplates gets all of the current templates stored in the VariableConfig
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) GetConstants
deprecated
added in
v0.64.0
func (vc *VariableConfig) GetConstants() []api.Constant
GetConstants fetches the package constants.
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) GetSetVariable
deprecated
func (vc *VariableConfig) GetSetVariable(name string) (*SetVariable, bool)
GetSetVariable gets a variable set within a VariableConfig by its name
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) GetSetVariableMap
deprecated
added in
v0.64.0
func (vc *VariableConfig) GetSetVariableMap() SetVariableMap
GetSetVariableMap retrieves all SetVariables
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) PopulateVariables
deprecated
func (vc *VariableConfig) PopulateVariables(variables []api.InteractiveVariable, presetVariables map[string]string) error
PopulateVariables handles setting the active variables within a VariableConfig's SetVariableMap
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) ReplaceTextTemplate
deprecated
func (vc *VariableConfig) ReplaceTextTemplate(path string) (err error)
ReplaceTextTemplate loads a file from a given path, replaces text in it and writes it back in place.
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) SetApplicationTemplates
deprecated
func (vc *VariableConfig) SetApplicationTemplates(applicationTemplates map[string]*TextTemplate)
SetApplicationTemplates sets the application-specific templates for the variable config (i.e. ZARF_REGISTRY for Zarf)
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) SetConstants
deprecated
func (vc *VariableConfig) SetConstants(constants []api.Constant)
SetConstants sets the constants for a variable config (templated as PREFIX_CONST_NAME)
Deprecated: Only supported by deprecated v1alpha1 packages.
func (*VariableConfig) SetVariable
deprecated
func (vc *VariableConfig) SetVariable(name, value string, sensitive bool, autoIndent bool, varType api.VariableType)
SetVariable sets a variable in a VariableConfig's SetVariableMap
Deprecated: Only supported by deprecated v1alpha1 packages.