apimachinery: k8s.io/apimachinery/pkg/apis/meta/v1/unstructured Index | Files | Directories

package unstructured

import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

Index

Package Files

helpers.go unstructured.go unstructured_list.go zz_generated.deepcopy.go

Variables

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.

func NestedBool Uses

func NestedBool(obj map[string]interface{}, fields ...string) (bool, bool, error)

NestedBool returns the bool value of a nested field. Returns false if value is not found and an error if not a bool.

func NestedFieldCopy Uses

func NestedFieldCopy(obj map[string]interface{}, fields ...string) (interface{}, bool, error)

NestedFieldCopy returns a deep copy of the value of a nested field. Returns false if the value is missing. No error is returned for a nil field.

Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.

func NestedFieldNoCopy Uses

func NestedFieldNoCopy(obj map[string]interface{}, fields ...string) (interface{}, bool, error)

NestedFieldNoCopy returns a reference to a nested field. Returns false if value is not found and an error if unable to traverse obj.

Note: fields passed to this function are treated as keys within the passed object; no array/slice syntax is supported.

func NestedFloat64 Uses

func NestedFloat64(obj map[string]interface{}, fields ...string) (float64, bool, error)

NestedFloat64 returns the float64 value of a nested field. Returns false if value is not found and an error if not a float64.

func NestedInt64 Uses

func NestedInt64(obj map[string]interface{}, fields ...string) (int64, bool, error)

NestedInt64 returns the int64 value of a nested field. Returns false if value is not found and an error if not an int64.

func NestedMap Uses

func NestedMap(obj map[string]interface{}, fields ...string) (map[string]interface{}, bool, error)

NestedMap returns a deep copy of map[string]interface{} value of a nested field. Returns false if value is not found and an error if not a map[string]interface{}.

func NestedSlice Uses

func NestedSlice(obj map[string]interface{}, fields ...string) ([]interface{}, bool, error)

NestedSlice returns a deep copy of []interface{} value of a nested field. Returns false if value is not found and an error if not a []interface{}.

func NestedString Uses

func NestedString(obj map[string]interface{}, fields ...string) (string, bool, error)

NestedString returns the string value of a nested field. Returns false if value is not found and an error if not a string.

func NestedStringMap Uses

func NestedStringMap(obj map[string]interface{}, fields ...string) (map[string]string, bool, error)

NestedStringMap returns a copy of map[string]string value of a nested field. Returns false if value is not found and an error if not a map[string]interface{} or contains non-string values in the map.

func NestedStringSlice Uses

func NestedStringSlice(obj map[string]interface{}, fields ...string) ([]string, bool, error)

NestedStringSlice returns a copy of []string value of a nested field. Returns false if value is not found and an error if not a []interface{} or contains non-string items in the slice.

func NewJSONFallbackEncoder Uses

func NewJSONFallbackEncoder(encoder runtime.Encoder) runtime.Encoder

func RemoveNestedField Uses

func RemoveNestedField(obj map[string]interface{}, fields ...string)

RemoveNestedField removes the nested field from the obj.

func SetNestedField Uses

func SetNestedField(obj map[string]interface{}, value interface{}, fields ...string) error

SetNestedField sets the value of a nested field to a deep copy of the value provided. Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.

func SetNestedMap Uses

func SetNestedMap(obj map[string]interface{}, value map[string]interface{}, fields ...string) error

SetNestedMap sets the map[string]interface{} value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.

func SetNestedSlice Uses

func SetNestedSlice(obj map[string]interface{}, value []interface{}, fields ...string) error

SetNestedSlice sets the slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.

func SetNestedStringMap Uses

func SetNestedStringMap(obj map[string]interface{}, value map[string]string, fields ...string) error

SetNestedStringMap sets the map[string]string value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.

func SetNestedStringSlice Uses

func SetNestedStringSlice(obj map[string]interface{}, value []string, fields ...string) error

SetNestedStringSlice sets the string slice value of a nested field. Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.

type Unstructured Uses

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. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:deepcopy-gen=true

func (*Unstructured) DeepCopy Uses

func (in *Unstructured) DeepCopy() *Unstructured

func (*Unstructured) DeepCopyInto Uses

func (in *Unstructured) DeepCopyInto(out *Unstructured)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Unstructured) DeepCopyObject Uses

func (in *Unstructured) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Unstructured) EachListItem Uses

func (obj *Unstructured) EachListItem(fn func(runtime.Object) error) error

func (*Unstructured) GetAPIVersion Uses

func (u *Unstructured) GetAPIVersion() string

func (*Unstructured) GetAnnotations Uses

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

func (*Unstructured) GetClusterName Uses

func (u *Unstructured) GetClusterName() string

func (*Unstructured) GetContinue Uses

func (u *Unstructured) GetContinue() string

func (*Unstructured) GetCreationTimestamp Uses

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

func (*Unstructured) GetDeletionGracePeriodSeconds Uses

func (u *Unstructured) GetDeletionGracePeriodSeconds() *int64

func (*Unstructured) GetDeletionTimestamp Uses

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

func (*Unstructured) GetFinalizers Uses

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

func (*Unstructured) GetGenerateName Uses

func (u *Unstructured) GetGenerateName() string

func (*Unstructured) GetGeneration Uses

func (u *Unstructured) GetGeneration() int64

func (*Unstructured) GetKind Uses

func (u *Unstructured) GetKind() string

func (*Unstructured) GetLabels Uses

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

func (*Unstructured) GetManagedFields Uses

func (u *Unstructured) GetManagedFields() []metav1.ManagedFieldsEntry

func (*Unstructured) GetName Uses

func (u *Unstructured) GetName() string

func (*Unstructured) GetNamespace Uses

func (u *Unstructured) GetNamespace() string

func (*Unstructured) GetObjectKind Uses

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

func (*Unstructured) GetOwnerReferences Uses

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

func (*Unstructured) GetRemainingItemCount Uses

func (u *Unstructured) GetRemainingItemCount() *int64

func (*Unstructured) GetResourceVersion Uses

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

func (*Unstructured) GetUID Uses

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

func (*Unstructured) GroupVersionKind Uses

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

func (*Unstructured) IsList Uses

func (obj *Unstructured) IsList() bool

func (*Unstructured) MarshalJSON Uses

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) NewEmptyInstance Uses

func (in *Unstructured) NewEmptyInstance() runtime.Unstructured

NewEmptyInstance returns a new instance of the concrete type containing only kind/apiVersion and no other data. This should be called instead of reflect.New() for unstructured types because the go type alone does not preserve kind/apiVersion info.

func (*Unstructured) SetAPIVersion Uses

func (u *Unstructured) SetAPIVersion(version string)

func (*Unstructured) SetAnnotations Uses

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

func (*Unstructured) SetClusterName Uses

func (u *Unstructured) SetClusterName(clusterName string)

func (*Unstructured) SetContinue Uses

func (u *Unstructured) SetContinue(c string)

func (*Unstructured) SetCreationTimestamp Uses

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

func (*Unstructured) SetDeletionGracePeriodSeconds Uses

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

func (*Unstructured) SetDeletionTimestamp Uses

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

func (*Unstructured) SetFinalizers Uses

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

func (*Unstructured) SetGenerateName Uses

func (u *Unstructured) SetGenerateName(generateName string)

func (*Unstructured) SetGeneration Uses

func (u *Unstructured) SetGeneration(generation int64)

func (*Unstructured) SetGroupVersionKind Uses

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

func (*Unstructured) SetKind Uses

func (u *Unstructured) SetKind(kind string)

func (*Unstructured) SetLabels Uses

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

func (*Unstructured) SetManagedFields Uses

func (u *Unstructured) SetManagedFields(managedFields []metav1.ManagedFieldsEntry)

func (*Unstructured) SetName Uses

func (u *Unstructured) SetName(name string)

func (*Unstructured) SetNamespace Uses

func (u *Unstructured) SetNamespace(namespace string)

func (*Unstructured) SetOwnerReferences Uses

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

func (*Unstructured) SetRemainingItemCount Uses

func (u *Unstructured) SetRemainingItemCount(c *int64)

func (*Unstructured) SetResourceVersion Uses

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

func (*Unstructured) SetUID Uses

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

func (*Unstructured) SetUnstructuredContent Uses

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

func (*Unstructured) ToList Uses

func (obj *Unstructured) ToList() (*UnstructuredList, error)

func (*Unstructured) UnmarshalJSON Uses

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 Uses

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

type UnstructuredList Uses

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. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:deepcopy-gen=true

func (*UnstructuredList) DeepCopy Uses

func (u *UnstructuredList) DeepCopy() *UnstructuredList

func (*UnstructuredList) DeepCopyInto Uses

func (in *UnstructuredList) DeepCopyInto(out *UnstructuredList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UnstructuredList) DeepCopyObject Uses

func (in *UnstructuredList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*UnstructuredList) EachListItem Uses

func (u *UnstructuredList) EachListItem(fn func(runtime.Object) error) error

func (*UnstructuredList) GetAPIVersion Uses

func (u *UnstructuredList) GetAPIVersion() string

func (*UnstructuredList) GetContinue Uses

func (u *UnstructuredList) GetContinue() string

func (*UnstructuredList) GetKind Uses

func (u *UnstructuredList) GetKind() string

func (*UnstructuredList) GetObjectKind Uses

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

func (*UnstructuredList) GetRemainingItemCount Uses

func (u *UnstructuredList) GetRemainingItemCount() *int64

func (*UnstructuredList) GetResourceVersion Uses

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

func (*UnstructuredList) GroupVersionKind Uses

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

func (*UnstructuredList) IsList Uses

func (u *UnstructuredList) IsList() bool

func (*UnstructuredList) MarshalJSON Uses

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) NewEmptyInstance Uses

func (u *UnstructuredList) NewEmptyInstance() runtime.Unstructured

NewEmptyInstance returns a new instance of the concrete type containing only kind/apiVersion and no other data. This should be called instead of reflect.New() for unstructured types because the go type alone does not preserve kind/apiVersion info.

func (*UnstructuredList) SetAPIVersion Uses

func (u *UnstructuredList) SetAPIVersion(version string)

func (*UnstructuredList) SetContinue Uses

func (u *UnstructuredList) SetContinue(c string)

func (*UnstructuredList) SetGroupVersionKind Uses

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

func (*UnstructuredList) SetKind Uses

func (u *UnstructuredList) SetKind(kind string)

func (*UnstructuredList) SetRemainingItemCount Uses

func (u *UnstructuredList) SetRemainingItemCount(c *int64)

func (*UnstructuredList) SetResourceVersion Uses

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

func (*UnstructuredList) SetUnstructuredContent Uses

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

SetUnstructuredContent obeys the conventions of List and keeps Items and the items array in sync. If items is not an array of objects in the incoming map, then any mismatched item will be removed.

func (*UnstructuredList) UnmarshalJSON Uses

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 Uses

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

UnstructuredContent returns a map contain an overlay of the Items field onto the Object field. Items always overwrites overlay.

Directories

PathSynopsis
unstructuredscheme

Package unstructured imports 13 packages (graph) and is imported by 1127 packages. Updated 2019-10-03. Refresh now. Tools for package owners.