unstructured

package
v0.0.0-...-d94079d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnstructuredJSONScheme runtime.Codec = unstructuredJSONScheme{}

UnstructuredJSONScheme is capable of converting JSON data into the Unstructured type, which can be used for generic access to objects without a predefined scheme. TODO: move into serializer/json.

Functions

This section is empty.

Types

type Unstructured

type Unstructured struct {
	// Object is a JSON compatible map with string, float, int, bool, []interface{}, or
	// map[string]interface{}
	// children.
	Object map[string]interface{}
}

Unstructured allows objects that do not have Golang structs registered to be manipulated generically. This can be used to deal with the API objects from a plug-in. Unstructured objects still have functioning TypeMeta features-- kind, version, etc.

WARNING: This object has accessors for the v1 standard metadata. You *MUST NOT* use this type if you are dealing with objects that are not in the server meta v1 schema.

TODO: make the serialization part of this type distinct from the field accessors.

func (*Unstructured) GetAPIVersion

func (u *Unstructured) GetAPIVersion() string

func (*Unstructured) GetAnnotations

func (u *Unstructured) GetAnnotations() map[string]string

func (*Unstructured) GetClusterName

func (u *Unstructured) GetClusterName() string

func (*Unstructured) GetCreationTimestamp

func (u *Unstructured) GetCreationTimestamp() metav1.Time

func (*Unstructured) GetDeletionGracePeriodSeconds

func (u *Unstructured) GetDeletionGracePeriodSeconds() *int64

func (*Unstructured) GetDeletionTimestamp

func (u *Unstructured) GetDeletionTimestamp() *metav1.Time

func (*Unstructured) GetFinalizers

func (u *Unstructured) GetFinalizers() []string

func (*Unstructured) GetGenerateName

func (u *Unstructured) GetGenerateName() string

func (*Unstructured) GetGeneration

func (u *Unstructured) GetGeneration() int64

func (*Unstructured) GetInitializers

func (u *Unstructured) GetInitializers() *metav1.Initializers

func (*Unstructured) GetKind

func (u *Unstructured) GetKind() string

func (*Unstructured) GetLabels

func (u *Unstructured) GetLabels() map[string]string

func (*Unstructured) GetName

func (u *Unstructured) GetName() string

func (*Unstructured) GetNamespace

func (u *Unstructured) GetNamespace() string

func (*Unstructured) GetObjectKind

func (obj *Unstructured) GetObjectKind() schema.ObjectKind

func (*Unstructured) GetOwnerReferences

func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference

func (*Unstructured) GetResourceVersion

func (u *Unstructured) GetResourceVersion() string
func (u *Unstructured) GetSelfLink() string

func (*Unstructured) GetUID

func (u *Unstructured) GetUID() types.UID

func (*Unstructured) GroupVersionKind

func (u *Unstructured) GroupVersionKind() schema.GroupVersionKind

func (*Unstructured) IsList

func (obj *Unstructured) IsList() bool

func (*Unstructured) IsUnstructuredObject

func (obj *Unstructured) IsUnstructuredObject()

func (*Unstructured) MarshalJSON

func (u *Unstructured) MarshalJSON() ([]byte, error)

MarshalJSON ensures that the unstructured object produces proper JSON when passed to Go's standard JSON library.

func (*Unstructured) SetAPIVersion

func (u *Unstructured) SetAPIVersion(version string)

func (*Unstructured) SetAnnotations

func (u *Unstructured) SetAnnotations(annotations map[string]string)

func (*Unstructured) SetClusterName

func (u *Unstructured) SetClusterName(clusterName string)

func (*Unstructured) SetCreationTimestamp

func (u *Unstructured) SetCreationTimestamp(timestamp metav1.Time)

func (*Unstructured) SetDeletionGracePeriodSeconds

func (u *Unstructured) SetDeletionGracePeriodSeconds(deletionGracePeriodSeconds *int64)

func (*Unstructured) SetDeletionTimestamp

func (u *Unstructured) SetDeletionTimestamp(timestamp *metav1.Time)

func (*Unstructured) SetFinalizers

func (u *Unstructured) SetFinalizers(finalizers []string)

func (*Unstructured) SetGenerateName

func (u *Unstructured) SetGenerateName(name string)

func (*Unstructured) SetGeneration

func (u *Unstructured) SetGeneration(generation int64)

func (*Unstructured) SetGroupVersionKind

func (u *Unstructured) SetGroupVersionKind(gvk schema.GroupVersionKind)

func (*Unstructured) SetInitializers

func (u *Unstructured) SetInitializers(initializers *metav1.Initializers)

func (*Unstructured) SetKind

func (u *Unstructured) SetKind(kind string)

func (*Unstructured) SetLabels

func (u *Unstructured) SetLabels(labels map[string]string)

func (*Unstructured) SetName

func (u *Unstructured) SetName(name string)

func (*Unstructured) SetNamespace

func (u *Unstructured) SetNamespace(namespace string)

func (*Unstructured) SetOwnerReferences

func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference)

func (*Unstructured) SetResourceVersion

func (u *Unstructured) SetResourceVersion(version string)
func (u *Unstructured) SetSelfLink(selfLink string)

func (*Unstructured) SetUID

func (u *Unstructured) SetUID(uid types.UID)

func (*Unstructured) UnmarshalJSON

func (u *Unstructured) UnmarshalJSON(b []byte) error

UnmarshalJSON ensures that the unstructured object properly decodes JSON when passed to Go's standard JSON library.

func (*Unstructured) UnstructuredContent

func (obj *Unstructured) UnstructuredContent() map[string]interface{}

type UnstructuredList

type UnstructuredList struct {
	Object map[string]interface{}

	// Items is a list of unstructured objects.
	Items []Unstructured `json:"items"`
}

UnstructuredList allows lists that do not have Golang structs registered to be manipulated generically. This can be used to deal with the API lists from a plug-in.

func (*UnstructuredList) GetAPIVersion

func (u *UnstructuredList) GetAPIVersion() string

func (*UnstructuredList) GetKind

func (u *UnstructuredList) GetKind() string

func (*UnstructuredList) GetObjectKind

func (obj *UnstructuredList) GetObjectKind() schema.ObjectKind

func (*UnstructuredList) GetResourceVersion

func (u *UnstructuredList) GetResourceVersion() string
func (u *UnstructuredList) GetSelfLink() string

func (*UnstructuredList) GroupVersionKind

func (u *UnstructuredList) GroupVersionKind() schema.GroupVersionKind

func (*UnstructuredList) IsList

func (obj *UnstructuredList) IsList() bool

func (*UnstructuredList) IsUnstructuredObject

func (obj *UnstructuredList) IsUnstructuredObject()

func (*UnstructuredList) MarshalJSON

func (u *UnstructuredList) MarshalJSON() ([]byte, error)

MarshalJSON ensures that the unstructured list object produces proper JSON when passed to Go's standard JSON library.

func (*UnstructuredList) SetAPIVersion

func (u *UnstructuredList) SetAPIVersion(version string)

func (*UnstructuredList) SetGroupVersionKind

func (u *UnstructuredList) SetGroupVersionKind(gvk schema.GroupVersionKind)

func (*UnstructuredList) SetKind

func (u *UnstructuredList) SetKind(kind string)

func (*UnstructuredList) SetResourceVersion

func (u *UnstructuredList) SetResourceVersion(version string)
func (u *UnstructuredList) SetSelfLink(selfLink string)

func (*UnstructuredList) UnmarshalJSON

func (u *UnstructuredList) UnmarshalJSON(b []byte) error

UnmarshalJSON ensures that the unstructured list object properly decodes JSON when passed to Go's standard JSON library.

func (*UnstructuredList) UnstructuredContent

func (obj *UnstructuredList) UnstructuredContent() map[string]interface{}

UnstructuredContent returns a map contain an overlay of the Items field onto the Object field. Items always overwrites overlay. Changing "items" in the returned object will affect items in the underlying Items field, but changing the "items" slice itself will have no effect. TODO: expose SetUnstructuredContent on runtime.Unstructured that allows items to be changed.

type UnstructuredObjectConverter

type UnstructuredObjectConverter struct{}

UnstructuredObjectConverter is an ObjectConverter for use with Unstructured objects. Since it has no schema or type information, it will only succeed for no-op conversions. This is provided as a sane implementation for APIs that require an object converter.

func (UnstructuredObjectConverter) Convert

func (UnstructuredObjectConverter) Convert(in, out, context interface{}) error

func (UnstructuredObjectConverter) ConvertFieldLabel

func (UnstructuredObjectConverter) ConvertFieldLabel(version, kind, label, value string) (string, string, error)

func (UnstructuredObjectConverter) ConvertToVersion

Jump to

Keyboard shortcuts

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