Documentation
¶
Index ¶
- Variables
- func NestedBool(obj map[string]interface{}, fields ...string) (bool, bool, error)
- func NestedFieldCopy(obj map[string]interface{}, fields ...string) (interface{}, bool, error)
- func NestedFieldNoCopy(obj map[string]interface{}, fields ...string) (interface{}, bool, error)
- func NestedFloat64(obj map[string]interface{}, fields ...string) (float64, bool, error)
- func NestedInt64(obj map[string]interface{}, fields ...string) (int64, bool, error)
- func NestedMap(obj map[string]interface{}, fields ...string) (map[string]interface{}, bool, error)
- func NestedSlice(obj map[string]interface{}, fields ...string) ([]interface{}, bool, error)
- func NestedString(obj map[string]interface{}, fields ...string) (string, bool, error)
- func NestedStringMap(obj map[string]interface{}, fields ...string) (map[string]string, bool, error)
- func NestedStringSlice(obj map[string]interface{}, fields ...string) ([]string, bool, error)
- func RemoveNestedField(obj map[string]interface{}, fields ...string)
- func SetNestedField(obj map[string]interface{}, value interface{}, fields ...string) error
- func SetNestedMap(obj map[string]interface{}, value map[string]interface{}, fields ...string) error
- func SetNestedSlice(obj map[string]interface{}, value []interface{}, fields ...string) error
- func SetNestedStringMap(obj map[string]interface{}, value map[string]string, fields ...string) error
- func SetNestedStringSlice(obj map[string]interface{}, value []string, fields ...string) error
- type JSONFallbackEncoder
- type Unstructured
- func (in *Unstructured) DeepCopy() *Unstructured
- func (in *Unstructured) DeepCopyInto(out *Unstructured)
- func (in *Unstructured) DeepCopyObject() runtime.Object
- func (obj *Unstructured) EachListItem(fn func(runtime.Object) error) error
- func (u *Unstructured) GetAPIVersion() string
- func (u *Unstructured) GetAnnotations() map[string]string
- func (u *Unstructured) GetClusterName() string
- func (u *Unstructured) GetContinue() string
- func (u *Unstructured) GetCreationTimestamp() metav1.Time
- func (u *Unstructured) GetDeletionGracePeriodSeconds() *int64
- func (u *Unstructured) GetDeletionTimestamp() *metav1.Time
- func (u *Unstructured) GetFinalizers() []string
- func (u *Unstructured) GetGenerateName() string
- func (u *Unstructured) GetGeneration() int64
- func (u *Unstructured) GetInitializers() *metav1.Initializers
- func (u *Unstructured) GetKind() string
- func (u *Unstructured) GetLabels() map[string]string
- func (u *Unstructured) GetName() string
- func (u *Unstructured) GetNamespace() string
- func (obj *Unstructured) GetObjectKind() schema.ObjectKind
- func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference
- func (u *Unstructured) GetResourceVersion() string
- func (u *Unstructured) GetSelfLink() string
- func (u *Unstructured) GetUID() types.UID
- func (u *Unstructured) GroupVersionKind() schema.GroupVersionKind
- func (obj *Unstructured) IsList() bool
- func (u *Unstructured) MarshalJSON() ([]byte, error)
- func (u *Unstructured) SetAPIVersion(version string)
- func (u *Unstructured) SetAnnotations(annotations map[string]string)
- func (u *Unstructured) SetClusterName(clusterName string)
- func (u *Unstructured) SetContinue(c string)
- func (u *Unstructured) SetCreationTimestamp(timestamp metav1.Time)
- func (u *Unstructured) SetDeletionGracePeriodSeconds(deletionGracePeriodSeconds *int64)
- func (u *Unstructured) SetDeletionTimestamp(timestamp *metav1.Time)
- func (u *Unstructured) SetFinalizers(finalizers []string)
- func (u *Unstructured) SetGenerateName(name string)
- func (u *Unstructured) SetGeneration(generation int64)
- func (u *Unstructured) SetGroupVersionKind(gvk schema.GroupVersionKind)
- func (u *Unstructured) SetInitializers(initializers *metav1.Initializers)
- func (u *Unstructured) SetKind(kind string)
- func (u *Unstructured) SetLabels(labels map[string]string)
- func (u *Unstructured) SetName(name string)
- func (u *Unstructured) SetNamespace(namespace string)
- func (u *Unstructured) SetOwnerReferences(references []metav1.OwnerReference)
- func (u *Unstructured) SetResourceVersion(version string)
- func (u *Unstructured) SetSelfLink(selfLink string)
- func (u *Unstructured) SetUID(uid types.UID)
- func (obj *Unstructured) SetUnstructuredContent(content map[string]interface{})
- func (obj *Unstructured) ToList() (*UnstructuredList, error)
- func (u *Unstructured) UnmarshalJSON(b []byte) error
- func (obj *Unstructured) UnstructuredContent() map[string]interface{}
- type UnstructuredList
- func (u *UnstructuredList) DeepCopy() *UnstructuredList
- func (in *UnstructuredList) DeepCopyInto(out *UnstructuredList)
- func (in *UnstructuredList) DeepCopyObject() runtime.Object
- func (u *UnstructuredList) EachListItem(fn func(runtime.Object) error) error
- func (u *UnstructuredList) GetAPIVersion() string
- func (u *UnstructuredList) GetContinue() string
- func (u *UnstructuredList) GetKind() string
- func (u *UnstructuredList) GetObjectKind() schema.ObjectKind
- func (u *UnstructuredList) GetResourceVersion() string
- func (u *UnstructuredList) GetSelfLink() string
- func (u *UnstructuredList) GroupVersionKind() schema.GroupVersionKind
- func (u *UnstructuredList) IsList() bool
- func (u *UnstructuredList) MarshalJSON() ([]byte, error)
- func (u *UnstructuredList) SetAPIVersion(version string)
- func (u *UnstructuredList) SetContinue(c string)
- func (u *UnstructuredList) SetGroupVersionKind(gvk schema.GroupVersionKind)
- func (u *UnstructuredList) SetKind(kind string)
- func (u *UnstructuredList) SetResourceVersion(version string)
- func (u *UnstructuredList) SetSelfLink(selfLink string)
- func (obj *UnstructuredList) SetUnstructuredContent(content map[string]interface{})
- func (u *UnstructuredList) UnmarshalJSON(b []byte) error
- func (u *UnstructuredList) UnstructuredContent() map[string]interface{}
Constants ¶
This section is empty.
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.
Functions ¶
func NestedBool ¶ added in v1.9.0
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 ¶ added in v1.9.0
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.
func NestedFieldNoCopy ¶ added in v1.11.7
NestedFieldNoCopy returns a reference to a nested field. Returns false if value is not found and an error if unable to traverse obj.
func NestedFloat64 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 RemoveNestedField ¶ added in v1.9.0
RemoveNestedField removes the nested field from the obj.
func SetNestedField ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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 ¶ added in v1.9.0
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{}.
Types ¶
type JSONFallbackEncoder ¶ added in v1.11.7
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. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:deepcopy-gen=true
func (*Unstructured) DeepCopy ¶ added in v1.8.0
func (in *Unstructured) DeepCopy() *Unstructured
func (*Unstructured) DeepCopyInto ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (in *Unstructured) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Unstructured) EachListItem ¶ added in v1.8.0
func (obj *Unstructured) EachListItem(fn func(runtime.Object) error) error
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) GetContinue ¶ added in v1.8.0
func (u *Unstructured) GetContinue() string
func (*Unstructured) GetCreationTimestamp ¶
func (u *Unstructured) GetCreationTimestamp() metav1.Time
func (*Unstructured) GetDeletionGracePeriodSeconds ¶ added in v1.7.0
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 ¶ added in v1.7.0
func (u *Unstructured) GetGeneration() int64
func (*Unstructured) GetInitializers ¶ added in v1.7.0
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 (*Unstructured) GetSelfLink ¶
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) 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) SetContinue ¶ added in v1.8.0
func (u *Unstructured) SetContinue(c string)
func (*Unstructured) SetCreationTimestamp ¶
func (u *Unstructured) SetCreationTimestamp(timestamp metav1.Time)
func (*Unstructured) SetDeletionGracePeriodSeconds ¶ added in v1.7.0
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 ¶ added in v1.7.0
func (u *Unstructured) SetGeneration(generation int64)
func (*Unstructured) SetGroupVersionKind ¶
func (u *Unstructured) SetGroupVersionKind(gvk schema.GroupVersionKind)
func (*Unstructured) SetInitializers ¶ added in v1.7.0
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 (*Unstructured) SetSelfLink ¶
func (u *Unstructured) SetSelfLink(selfLink string)
func (*Unstructured) SetUID ¶
func (u *Unstructured) SetUID(uid types.UID)
func (*Unstructured) SetUnstructuredContent ¶ added in v1.9.0
func (obj *Unstructured) SetUnstructuredContent(content map[string]interface{})
func (*Unstructured) ToList ¶ added in v1.11.7
func (obj *Unstructured) ToList() (*UnstructuredList, error)
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. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:deepcopy-gen=true
func (*UnstructuredList) DeepCopy ¶ added in v1.8.0
func (u *UnstructuredList) DeepCopy() *UnstructuredList
func (*UnstructuredList) DeepCopyInto ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (in *UnstructuredList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*UnstructuredList) EachListItem ¶ added in v1.8.0
func (u *UnstructuredList) EachListItem(fn func(runtime.Object) error) error
func (*UnstructuredList) GetAPIVersion ¶
func (u *UnstructuredList) GetAPIVersion() string
func (*UnstructuredList) GetContinue ¶ added in v1.8.0
func (u *UnstructuredList) GetContinue() string
func (*UnstructuredList) GetKind ¶
func (u *UnstructuredList) GetKind() string
func (*UnstructuredList) GetObjectKind ¶
func (u *UnstructuredList) GetObjectKind() schema.ObjectKind
func (*UnstructuredList) GetResourceVersion ¶
func (u *UnstructuredList) GetResourceVersion() string
func (*UnstructuredList) GetSelfLink ¶
func (u *UnstructuredList) GetSelfLink() string
func (*UnstructuredList) GroupVersionKind ¶
func (u *UnstructuredList) GroupVersionKind() schema.GroupVersionKind
func (*UnstructuredList) IsList ¶
func (u *UnstructuredList) IsList() bool
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) SetContinue ¶ added in v1.8.0
func (u *UnstructuredList) SetContinue(c 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 (*UnstructuredList) SetSelfLink ¶
func (u *UnstructuredList) SetSelfLink(selfLink string)
func (*UnstructuredList) SetUnstructuredContent ¶ added in v1.9.0
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 ¶
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 (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.