utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package utils provides utility fns for maru

Package utils provides utility fns for maru

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatEnvVar added in v0.0.2

func FormatEnvVar(name, value string) string

FormatEnvVar format environment variables replacing non-alphanumeric characters with underscores and adding INPUT_ prefix

func MergeEnv added in v0.0.2

func MergeEnv(env1, env2 []string) []string

MergeEnv merges two environment variable arrays, replacing variables found in env2 with variables from env1 otherwise appending the variable from env1 to env2

func PopulateTemplateMap added in v0.0.2

func PopulateTemplateMap(zarfVariables []zarfTypes.ZarfPackageVariable, setVariables map[string]string) map[string]*TextTemplate

PopulateTemplateMap creates a template variable map

func TemplateString added in v0.0.2

func TemplateString(templateMap map[string]*TextTemplate, s string) string

TemplateString replaces ${...} with the value from the template map

func TemplateTaskActionsWithInputs added in v0.0.2

func TemplateTaskActionsWithInputs(task types.Task, withs map[string]string) ([]types.Action, error)

TemplateTaskActionsWithInputs templates a task's actions with the given inputs

func UseLogFile

func UseLogFile() error

UseLogFile writes output to stderr and a logFile.

Types

type TextTemplate added in v0.1.0

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

TextTemplate represents a value to be templated into a text file. todo: should be grabbing from Zarf but it's now private: https://github.com/defenseunicorns/zarf/issues/2395

Jump to

Keyboard shortcuts

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