Documentation ¶
Index ¶
- Constants
- func DeepMergeMaps(a, b map[string]interface{}) map[string]interface{}
- func FromJSON(b []byte) (map[string]interface{}, error)
- func FromYAML(b []byte) (map[string]interface{}, error)
- func HandleEnginePath(enginePath, path string) (string, string)
- func ParseEnvs(prefix string, i interface{}) error
- func PathMap(path string, s map[string]interface{}, isSecretPath bool) map[string]interface{}
- func RemoveCarriageReturns(s string) string
- func RemoveDuplicates(s []string) []string
- func RemoveExtension(file string) string
- func SortMapKeys(m map[string]interface{}) []string
- func SplitPath(path string) (string, string)
- func ToJSON(m interface{}) ([]byte, error)
- func ToMapStringInterface(i interface{}) map[string]interface{}
- func ToYAML(m interface{}) ([]byte, error)
- func TransformMap(p string, m map[string]interface{}, s *map[string]interface{})
- type Keys
Constants ¶
const (
// Delimiter / delimiter for splitting a path.
Delimiter = "/"
)
Variables ¶
This section is empty.
Functions ¶
func DeepMergeMaps ¶ added in v0.1.1
DeepMergeMaps takes two maps and deeply merges them together. https://stackoverflow.com/questions/62953360/golang-merge-deeply-two-maps/62954592#62954592
func HandleEnginePath ¶ added in v0.1.1
HandleEnginePath handles the engine path if one is specified.
func PathMap ¶ added in v0.1.0
PathMap takes a path like "a/b/c" and returns a map like map[a] -> map[b] -> map[c]. if isSecretPath is true, then c does not have a / as suffix.
func RemoveCarriageReturns ¶ added in v0.2.0
RemoveCarriageReturns removes \r mostly used for unit tests on windows OS.
func RemoveDuplicates ¶ added in v0.2.0
RemoveDuplicates removes duplicate elements from a string slice.
func RemoveExtension ¶ added in v0.2.0
RemoveExtension removes the extension of a specified filename.
func SortMapKeys ¶
SortMapKeys sorts the keys of a map.
func SplitPath ¶ added in v0.0.4
SplitPath splits a given path by / and returns the first element and the joined rest paths.
func ToMapStringInterface ¶ added in v0.0.11
func ToMapStringInterface(i interface{}) map[string]interface{}
ToMapStringInterface takes any value and returns the map string interface.
func TransformMap ¶ added in v0.1.0
TransformMap takes a multi leveled map and returns a map with its combined paths as the keys and the map as its value. Also see TestTransformMap().