utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 17 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 DownloadToFile added in v0.2.0

func DownloadToFile(src string, dst string) (err error)

DownloadToFile downloads a given URL to the target filepath

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 MakeTempDir added in v0.2.0

func MakeTempDir(basePath string) (string, error)

MakeTempDir creates a temp directory with the maru- 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 ReadYaml added in v0.2.0

func ReadYaml(path string, destConfig any) error

ReadYaml reads a yaml file and unmarshals it into a given config.

func TemplateString added in v0.0.2

func TemplateString[T any](setVariableMap variables.SetVariableMap[T], 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

This section is empty.

Jump to

Keyboard shortcuts

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