kunstruct

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 21 Imported by: 6

Documentation

Overview

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

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.

func NewKustHash

func NewKustHash() *kustHash

NewKustHash returns a kustHash object

Types

type KunstructuredFactoryImpl

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

KunstructuredFactoryImpl hides construction using apimachinery types.

func (*KunstructuredFactoryImpl) FromMap

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

FromMap returns an instance of Kunstructured.

func (*KunstructuredFactoryImpl) Hasher

Hasher returns a kunstructured hasher input: kunstructured; output: string hash.

func (*KunstructuredFactoryImpl) MakeConfigMap

func (kf *KunstructuredFactoryImpl) MakeConfigMap(
	ldr ifc.Loader,
	options *types.GeneratorOptions,
	args *types.ConfigMapArgs) (ifc.Kunstructured, error)

MakeConfigMap returns an instance of Kunstructured for ConfigMap

func (*KunstructuredFactoryImpl) MakeSecret

MakeSecret returns an instance of Kunstructured for Secret

func (*KunstructuredFactoryImpl) SliceFromBytes

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

SliceFromBytes returns a slice of Kunstructured.

type PathSection

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

A PathSection contains a list of nested fields, which may end with an indexable value. For instance, foo.bar resolves to a PathSection with 2 fields and no index, while foo[0].bar resolves to two path sections, the first containing the field foo and the index 0, and the second containing the field bar, with no index. The latter PathSection references the bar field of the first item in the foo list

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) GetBool

func (fs *UnstructAdapter) GetBool(path string) (bool, error)

GetBool returns value at the given fieldpath.

func (*UnstructAdapter) GetFieldValue

func (fs *UnstructAdapter) GetFieldValue(path string) (interface{}, error)

GetFieldValue returns the value at the given fieldpath.

func (*UnstructAdapter) GetFloat64

func (fs *UnstructAdapter) GetFloat64(path string) (float64, error)

GetFloat64 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) GetInt64

func (fs *UnstructAdapter) GetInt64(path string) (int64, error)

GetInt64 returns value at the given fieldpath.

func (*UnstructAdapter) GetMap

func (fs *UnstructAdapter) GetMap(path string) (map[string]interface{}, error)

GetMap returns value at the given fieldpath.

func (*UnstructAdapter) GetSlice

func (fs *UnstructAdapter) GetSlice(path string) ([]interface{}, error)

GetSlice returns value at the given fieldpath.

func (*UnstructAdapter) GetString

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

GetString returns value at the given fieldpath.

func (*UnstructAdapter) GetStringMap

func (fs *UnstructAdapter) GetStringMap(path string) (map[string]string, error)

GetStringMap returns value at the given fieldpath.

func (*UnstructAdapter) GetStringSlice

func (fs *UnstructAdapter) GetStringSlice(path string) ([]string, error)

GetStringSlice returns value at the given fieldpath.

func (*UnstructAdapter) Map

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

Map returns the unstructured content map.

func (*UnstructAdapter) MatchesAnnotationSelector

func (fs *UnstructAdapter) MatchesAnnotationSelector(selector string) (bool, error)

func (*UnstructAdapter) MatchesLabelSelector

func (fs *UnstructAdapter) MatchesLabelSelector(selector string) (bool, error)

func (*UnstructAdapter) Patch added in v3.0.2

func (fs *UnstructAdapter) Patch(patch ifc.Kunstructured) error

func (*UnstructAdapter) SetGvk added in v3.0.3

func (fs *UnstructAdapter) SetGvk(g gvk.Gvk)

SetGvk set the Gvk of the object to the input Gvk

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