template

package
v0.32.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package template provides functions for templating yaml files.

Package template provides functions for templating yaml files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessYamlFilesInPath

func ProcessYamlFilesInPath(path string, component types.ZarfComponent, values Values) ([]string, error)

ProcessYamlFilesInPath iterates over all yaml files in a given path and performs Zarf templating + image swapping.

func ReplaceTextTemplate added in v0.32.6

func ReplaceTextTemplate(path string, mappings map[string]*TextTemplate, deprecations map[string]string, templateRegex string) error

ReplaceTextTemplate loads a file from a given path, replaces text in it and writes it back in place.

Types

type TextTemplate added in v0.32.6

type TextTemplate struct {
	Sensitive  bool
	AutoIndent bool
	Type       types.VariableType
	Value      string
}

TextTemplate represents a value to be templated into a text file.

type Values

type Values struct {
	// contains filtered or unexported fields
}

Values contains the values to be used in the template.

func Generate

func Generate(cfg *types.PackagerConfig) (*Values, error)

Generate returns a Values struct with the values to be used in the template.

func (*Values) Apply

func (values *Values) Apply(component types.ZarfComponent, path string, ignoreReady bool) error

Apply renders the template and writes the result to the given path.

func (*Values) GetVariables added in v0.24.0

func (values *Values) GetVariables(component types.ZarfComponent) (templateMap map[string]*TextTemplate, deprecations map[string]string)

GetVariables returns the variables to be used in the template.

func (*Values) Ready

func (values *Values) Ready() bool

Ready returns true if the Values struct is ready to be used in the template.

func (*Values) SetState added in v0.32.5

func (values *Values) SetState(state *types.ZarfState)

SetState sets the state

Jump to

Keyboard shortcuts

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