datautil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package datautil provides utilities for working with data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAndMapStringArr

func ConvertAndMapStringArr(ifaceArr []interface{}, f func(string) string) []string

ConvertAndMapStringArr converts an array of interfaces to an array of strings, applying the supplied function to each element.

func ConvertStringArr

func ConvertStringArr(ifaceArr []interface{}) []string

ConvertStringArr converts an array of interfaces to an array of strings.

func ConvertVariables

func ConvertVariables(vars []cfclient.Variable) (map[string]string, map[string]string)

ConvertVariables converts an array of cfclient. Variables to 2 maps of key/value pairs - first one for un-encrypted variables second one for encrypted variables.

func FlattenStringArr

func FlattenStringArr(sArr []string) []interface{}

FlattenStringArr flattens an array of strings.

func YamlToJson

func YamlToJson(yamlString string) (string, error)

YamlToJson converts a YAML string to JSON

This function preserves the order of map keys (courtesy of yj package). If this were to use yaml.Unmarshal() and json.Marshal() instead, the order of map keys would be lost.

func Yq

func Yq(yamlString string, expression string) (string, error)

Yq gets a value from a YAML string using yq

Types

This section is empty.

Jump to

Keyboard shortcuts

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