utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 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 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 JoinURLRepoPath added in v0.5.0

func JoinURLRepoPath(currentURL *url.URL, includeFilePath string) (*url.URL, error)

JoinURLRepoPath joins a path in a URL (detecting the URL type)

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 ReadRemoteYaml added in v0.5.0

func ReadRemoteYaml(location string, destConfig any, auth map[string]string) (err error)

ReadRemoteYaml makes a get request to retrieve a given file from a URL

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 TemplateTaskAction added in v0.2.3

func TemplateTaskAction[T any](action types.Action, withs map[string]string, inputs map[string]types.InputParameter, setVarMap variables.SetVariableMap[T]) (types.Action, error)

TemplateTaskAction templates a task's actions with the given inputs and variables

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