vars

package
v0.0.0-...-6503209 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrossProduct

func CrossProduct(loopVars []string, vars map[string]interface{}) ([]map[string]interface{}, error)

func Expand

func Expand(obj interface{}, lookup map[string]interface{}) (interface{}, error)

Expand shell-like variable references (from 'lookup') into string fields and map values of 'obj', recursively.

The recursion will navigate maps and public fields of structs, but will leave objects with unexported fields untouched so as not to disrupt complex types with internal private state.

This results in the most intuitive behavior where calling Expand on a value of the following type:

type MyType struct {
   Name string
   Pattern *regexp.Regexp
}

will do the sensible thing of processing Name but leaving Pattern alone (the *regexp.Regexp pointer will be copied unmodified to the result object).

Types

This section is empty.

Jump to

Keyboard shortcuts

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