utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsolePrinter

func ConsolePrinter(msg string)

func FileExists

func FileExists(filename string) (bool, error)

FileExists checks if specified file exists.

func GetNamespaceSets

func GetNamespaceSets(nsInclude string, nsExclude string) (sets.String, sets.String)

func IsNamespaceIncluded

func IsNamespaceIncluded(namespace string, nsInclude sets.String, nsExclude sets.String) bool

func ReadObjectList added in v0.5.0

func ReadObjectList(r io.Reader) ([]runtime.Object, error)

func ReadObjectsFromFile added in v0.5.0

func ReadObjectsFromFile(filename string) ([]runtime.Object, error)

func ReadYamlManifest added in v0.5.0

func ReadYamlManifest(r io.Reader) ([]runtime.Object, error)

func StructToMap added in v0.10.0

func StructToMap(v interface{}) map[string]string

func WriteFile

func WriteFile(outfile string, data string) error

Types

type Map added in v0.10.0

type Map map[string]string

func Flatten added in v0.10.0

func Flatten(thing map[string]interface{}) Map

Flatten takes a structure and turns into a flat map[string]string.

Within the "thing" parameter, only primitive values are allowed. Structs are not supported. Therefore, it can only be slices, maps, primitives, and any combination of those together.

See the tests for examples of what inputs are turned into.

Jump to

Keyboard shortcuts

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