utils

package
v0.0.0-...-081007f Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 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

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

func ReadObjectsFromFile

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

func ReadYamlManifest

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

func StructToMap

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

func WriteFile

func WriteFile(outfile string, data string) error

Types

type Map

type Map map[string]string

func Flatten

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