variables

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 2

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SetVariable

type SetVariable struct {
	api.Variable
	Value string
}

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.

Jump to

Keyboard shortcuts

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