kunstruct

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package kunstruct provides unstructured from api machinery and factory for creating unstructured

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKunstructuredFactoryImpl

func NewKunstructuredFactoryImpl() ifc.KunstructuredFactory

NewKunstructuredFactoryImpl returns a factory.

func NewKunstructuredFromObject

func NewKunstructuredFromObject(obj runtime.Object) (ifc.Kunstructured, error)

NewKunstructuredFromObject returns a new instance of Kunstructured.

Types

type KunstructurerFactoryImpl

type KunstructurerFactoryImpl struct {
	// contains filtered or unexported fields
}

KunstructurerFactoryImpl hides construction using apimachinery types.

func (*KunstructurerFactoryImpl) FromMap

func (kf *KunstructurerFactoryImpl) FromMap(
	m map[string]interface{}) ifc.Kunstructured

FromMap returns an instance of Kunstructured.

func (*KunstructurerFactoryImpl) MakeConfigMap

MakeConfigMap returns an instance of Kunstructured for ConfigMap

func (*KunstructurerFactoryImpl) MakeSecret

MakeSecret returns an instance of Kunstructured for Secret

func (*KunstructurerFactoryImpl) Set

func (kf *KunstructurerFactoryImpl) Set(fs fs.FileSystem, ldr ifc.Loader)

Set sets loader, filesystem and workdirectory

func (*KunstructurerFactoryImpl) SliceFromBytes

func (kf *KunstructurerFactoryImpl) SliceFromBytes(
	in []byte) ([]ifc.Kunstructured, error)

SliceFromBytes returns a slice of Kunstructured.

type UnstructAdapter

type UnstructAdapter struct {
	unstructured.Unstructured
}

UnstructAdapter wraps unstructured.Unstructured from https://github.com/kubernetes/apimachinery/blob/master/

pkg/apis/meta/v1/unstructured/unstructured.go

to isolate dependence on apimachinery.

func (*UnstructAdapter) Copy

func (fs *UnstructAdapter) Copy() ifc.Kunstructured

Copy provides a copy behind an interface.

func (*UnstructAdapter) GetFieldValue

func (fs *UnstructAdapter) GetFieldValue(path string) (string, error)

GetFieldValue returns value at the given fieldpath.

func (*UnstructAdapter) GetGvk

func (fs *UnstructAdapter) GetGvk() gvk.Gvk

GetGvk returns the Gvk name of the object.

func (*UnstructAdapter) Map

func (fs *UnstructAdapter) Map() map[string]interface{}

Map returns the unstructured content map.

func (*UnstructAdapter) SetMap

func (fs *UnstructAdapter) SetMap(m map[string]interface{})

SetMap overrides the unstructured content map.

Jump to

Keyboard shortcuts

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