unstructuredutils

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package unstructuredutils provides utilities working with the unstructured.Unstructured type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

Read treats io.Reader as an incoming YAML or JSON stream and reads all unstructured.Unstructured objects of it.

The document has to be well-formed. For multi-doc YAMLs, '---' is used as separator. Empty sub-documents are filtered from the resulting list.

func ReadFile

func ReadFile(filename string) ([]unstructured.Unstructured, error)

ReadFile reads unstructured objects from a file with the given name. For further reference, have a look at Read.

func ReadFiles

func ReadFiles(pattern string) ([]unstructured.Unstructured, error)

ReadFiles reads unstructured objects from a folder with the given name (including sub folders) and file name matched with the pattern.

func UnstructuredSliceToObjectSlice

func UnstructuredSliceToObjectSlice(unstructureds []unstructured.Unstructured) []client.Object

UnstructuredSliceToObjectSlice transforms the given list of unstructured.Unstructured to a list of client.Object, copying the unstructured.Unstructured and using the pointers of them for the resulting client.Object.

func UnstructuredSliceToObjectSliceNoCopy

func UnstructuredSliceToObjectSliceNoCopy(unstructureds []unstructured.Unstructured) []client.Object

UnstructuredSliceToObjectSliceNoCopy transforms the given list of unstructured.Unstructured to a list of client.Object, performing no copy while doing so.

When creating the list, the resulting client.Object objects are obtained from having a pointer to the original slice item.

Types

This section is empty.

Jump to

Keyboard shortcuts

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