Documentation ¶
Index ¶
- func CopyMergeStrMap(a map[string]string, b map[string]string) map[string]string
- func GetChild(parent interface{}, key interface{}) (interface{}, bool, error)
- func MergeMap(a, b map[string]any)
- func MergeStrMap(a map[string]string, b map[string]string)
- func SetChild(parent interface{}, key interface{}, value interface{}) error
- type KeyPath
- type MyJsonPath
- func (j *MyJsonPath) Del(o *UnstructuredObject) error
- func (j *MyJsonPath) Get(o *UnstructuredObject) []interface{}
- func (j *MyJsonPath) GetFirst(o *UnstructuredObject) (interface{}, bool)
- func (j *MyJsonPath) GetFirstFromAny(o any) (interface{}, bool)
- func (j *MyJsonPath) GetFirstListOfObjects(o *UnstructuredObject) ([]*UnstructuredObject, bool, error)
- func (j *MyJsonPath) GetFirstObject(o *UnstructuredObject) (*UnstructuredObject, bool, error)
- func (j *MyJsonPath) GetFromAny(o any) []interface{}
- func (j *MyJsonPath) ListMatchingFields(o *UnstructuredObject) ([]KeyPath, error)
- func (j *MyJsonPath) Set(o *UnstructuredObject, v any) error
- func (j *MyJsonPath) SetOne(o *UnstructuredObject, v any) error
- type ObjectIterator
- func (it *ObjectIterator) IterateLeafs(cb ObjectIteratorFunc) error
- func (it *ObjectIterator) Key() interface{}
- func (it *ObjectIterator) KeyPath() KeyPath
- func (it *ObjectIterator) KeyPathCopy() KeyPath
- func (it *ObjectIterator) Parent() interface{}
- func (it *ObjectIterator) SetValue(v interface{}) error
- func (it *ObjectIterator) Value() interface{}
- type ObjectIteratorFunc
- type UnstructuredObject
- func FromFile(p string) (*UnstructuredObject, error)
- func FromFileMulti(p string) ([]*UnstructuredObject, error)
- func FromMap(o map[string]interface{}) *UnstructuredObject
- func FromString(s string) (*UnstructuredObject, error)
- func FromStringMulti(s string) ([]*UnstructuredObject, error)
- func FromStringMust(s string) *UnstructuredObject
- func FromStruct(o interface{}) (*UnstructuredObject, error)
- func FromStructMust(o interface{}) *UnstructuredObject
- func FromUnstructured(u *unstructured.Unstructured) *UnstructuredObject
- func New() *UnstructuredObject
- func (uo *UnstructuredObject) Clear()
- func (uo *UnstructuredObject) Clone() *UnstructuredObject
- func (uo *UnstructuredObject) DeepCopy() *UnstructuredObject
- func (uo *UnstructuredObject) DeepCopyInto(out *UnstructuredObject)
- func (uo *UnstructuredObject) GetK8sAnnotation(name string) *string
- func (uo *UnstructuredObject) GetK8sAnnotationBool(name string, defaultValue bool) (bool, error)
- func (uo *UnstructuredObject) GetK8sAnnotationBoolNoError(name string, defaultValue bool) bool
- func (uo *UnstructuredObject) GetK8sAnnotationBoolPtr(name string) (*bool, error)
- func (uo *UnstructuredObject) GetK8sAnnotations() map[string]string
- func (uo *UnstructuredObject) GetK8sAnnotationsWithRegex(r interface{}) map[string]string
- func (uo *UnstructuredObject) GetK8sCreationTime() time.Time
- func (uo *UnstructuredObject) GetK8sGVK() schema.GroupVersionKind
- func (uo *UnstructuredObject) GetK8sGeneration() int64
- func (uo *UnstructuredObject) GetK8sLabel(name string) *string
- func (uo *UnstructuredObject) GetK8sLabels() map[string]string
- func (uo *UnstructuredObject) GetK8sLabelsWithRegex(r interface{}) map[string]string
- func (uo *UnstructuredObject) GetK8sManagedFields() []*UnstructuredObject
- func (uo *UnstructuredObject) GetK8sName() string
- func (uo *UnstructuredObject) GetK8sNamespace() string
- func (uo *UnstructuredObject) GetK8sOwnerReferences() []*UnstructuredObject
- func (uo *UnstructuredObject) GetK8sRef() k8s.ObjectRef
- func (uo *UnstructuredObject) GetK8sResourceVersion() string
- func (uo *UnstructuredObject) GetK8sUid() string
- func (uo *UnstructuredObject) GetNestedBool(keys ...interface{}) (bool, bool, error)
- func (uo *UnstructuredObject) GetNestedField(keys ...interface{}) (interface{}, bool, error)
- func (uo *UnstructuredObject) GetNestedInt(keys ...interface{}) (int64, bool, error)
- func (uo *UnstructuredObject) GetNestedList(keys ...interface{}) ([]interface{}, bool, error)
- func (uo *UnstructuredObject) GetNestedObject(keys ...interface{}) (*UnstructuredObject, bool, error)
- func (uo *UnstructuredObject) GetNestedObjectList(keys ...interface{}) ([]*UnstructuredObject, bool, error)
- func (uo *UnstructuredObject) GetNestedObjectListNoErr(keys ...interface{}) []*UnstructuredObject
- func (uo *UnstructuredObject) GetNestedString(keys ...interface{}) (string, bool, error)
- func (uo *UnstructuredObject) GetNestedStringList(keys ...interface{}) ([]string, bool, error)
- func (uo *UnstructuredObject) GetNestedStringMapCopy(keys ...interface{}) (map[string]string, bool, error)
- func (uo *UnstructuredObject) IsZero() bool
- func (uo *UnstructuredObject) Keys() []string
- func (uo *UnstructuredObject) MarshalJSON() ([]byte, error)
- func (uo *UnstructuredObject) Merge(other *UnstructuredObject)
- func (uo *UnstructuredObject) MergeChild(child string, other *UnstructuredObject)
- func (uo *UnstructuredObject) MergeCopy(other *UnstructuredObject) *UnstructuredObject
- func (uo *UnstructuredObject) NewIterator() *ObjectIterator
- func (uo *UnstructuredObject) RemoveFieldsByPathRegex(path string) error
- func (uo *UnstructuredObject) RemoveK8sAnnotation(name string)
- func (uo *UnstructuredObject) RemoveNestedField(keys ...interface{}) error
- func (uo *UnstructuredObject) RemoveValueForKey(key string)
- func (uo *UnstructuredObject) ReplaceKeys(oldKey string, newKey string) error
- func (uo *UnstructuredObject) ReplaceValues(oldValue interface{}, newValue interface{}) error
- func (uo *UnstructuredObject) SetK8sAnnotation(name string, value string)
- func (uo *UnstructuredObject) SetK8sAnnotations(annotations map[string]string)
- func (uo *UnstructuredObject) SetK8sGVK(gvk schema.GroupVersionKind)
- func (uo *UnstructuredObject) SetK8sGVKs(g string, v string, k string)
- func (uo *UnstructuredObject) SetK8sLabel(name string, value string)
- func (uo *UnstructuredObject) SetK8sLabels(labels map[string]string)
- func (uo *UnstructuredObject) SetK8sName(name string)
- func (uo *UnstructuredObject) SetK8sNamespace(namespace string)
- func (uo *UnstructuredObject) SetK8sOwnerReferences(l []*UnstructuredObject)
- func (uo *UnstructuredObject) SetK8sResourceVersion(rv string)
- func (uo *UnstructuredObject) SetNestedField(value interface{}, keys ...interface{}) error
- func (uo *UnstructuredObject) SetNestedFieldDefault(defaultValue interface{}, keys ...interface{}) error
- func (uo *UnstructuredObject) SetNestedObjectList(items []*UnstructuredObject, keys ...interface{}) error
- func (uo *UnstructuredObject) SetValueForKey(key string, value any)
- func (uo *UnstructuredObject) ToMap() (map[string]any, error)
- func (uo *UnstructuredObject) ToStruct(out interface{}) error
- func (uo *UnstructuredObject) ToUnstructured() *unstructured.Unstructured
- func (uo *UnstructuredObject) UnmarshalJSON(b []byte) error
- func (uo *UnstructuredObject) ValueForKey(key string) (value any, has bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyMergeStrMap ¶
Types ¶
type KeyPath ¶ added in v2.11.0
type KeyPath []interface{}
func (KeyPath) ToJsonPath ¶ added in v2.11.0
type MyJsonPath ¶
type MyJsonPath struct {
// contains filtered or unexported fields
}
func NewMyJsonPath ¶
func NewMyJsonPath(p string) (*MyJsonPath, error)
func NewMyJsonPathMust ¶
func NewMyJsonPathMust(p string) *MyJsonPath
func (*MyJsonPath) Del ¶
func (j *MyJsonPath) Del(o *UnstructuredObject) error
func (*MyJsonPath) Get ¶
func (j *MyJsonPath) Get(o *UnstructuredObject) []interface{}
func (*MyJsonPath) GetFirst ¶
func (j *MyJsonPath) GetFirst(o *UnstructuredObject) (interface{}, bool)
func (*MyJsonPath) GetFirstFromAny ¶ added in v2.11.0
func (j *MyJsonPath) GetFirstFromAny(o any) (interface{}, bool)
func (*MyJsonPath) GetFirstListOfObjects ¶ added in v2.11.0
func (j *MyJsonPath) GetFirstListOfObjects(o *UnstructuredObject) ([]*UnstructuredObject, bool, error)
func (*MyJsonPath) GetFirstObject ¶ added in v2.11.0
func (j *MyJsonPath) GetFirstObject(o *UnstructuredObject) (*UnstructuredObject, bool, error)
func (*MyJsonPath) GetFromAny ¶ added in v2.11.0
func (j *MyJsonPath) GetFromAny(o any) []interface{}
func (*MyJsonPath) ListMatchingFields ¶
func (j *MyJsonPath) ListMatchingFields(o *UnstructuredObject) ([]KeyPath, error)
func (*MyJsonPath) Set ¶ added in v2.20.0
func (j *MyJsonPath) Set(o *UnstructuredObject, v any) error
func (*MyJsonPath) SetOne ¶ added in v2.23.0
func (j *MyJsonPath) SetOne(o *UnstructuredObject, v any) error
type ObjectIterator ¶
type ObjectIterator struct {
// contains filtered or unexported fields
}
func NewObjectIterator ¶
func NewObjectIterator(o map[string]interface{}) *ObjectIterator
func (*ObjectIterator) IterateLeafs ¶
func (it *ObjectIterator) IterateLeafs(cb ObjectIteratorFunc) error
func (*ObjectIterator) Key ¶
func (it *ObjectIterator) Key() interface{}
func (*ObjectIterator) KeyPath ¶
func (it *ObjectIterator) KeyPath() KeyPath
func (*ObjectIterator) KeyPathCopy ¶ added in v2.9.0
func (it *ObjectIterator) KeyPathCopy() KeyPath
func (*ObjectIterator) Parent ¶
func (it *ObjectIterator) Parent() interface{}
func (*ObjectIterator) SetValue ¶
func (it *ObjectIterator) SetValue(v interface{}) error
func (*ObjectIterator) Value ¶
func (it *ObjectIterator) Value() interface{}
type ObjectIteratorFunc ¶
type ObjectIteratorFunc func(it *ObjectIterator) error
type UnstructuredObject ¶
type UnstructuredObject struct {
Object map[string]interface{} `json:"-"`
}
+kubebuilder:pruning:PreserveUnknownFields
func FromFile ¶
func FromFile(p string) (*UnstructuredObject, error)
func FromFileMulti ¶ added in v2.16.0
func FromFileMulti(p string) ([]*UnstructuredObject, error)
func FromMap ¶
func FromMap(o map[string]interface{}) *UnstructuredObject
func FromString ¶
func FromString(s string) (*UnstructuredObject, error)
func FromStringMulti ¶
func FromStringMulti(s string) ([]*UnstructuredObject, error)
func FromStringMust ¶
func FromStringMust(s string) *UnstructuredObject
func FromStruct ¶
func FromStruct(o interface{}) (*UnstructuredObject, error)
func FromStructMust ¶ added in v2.23.4
func FromStructMust(o interface{}) *UnstructuredObject
func FromUnstructured ¶
func FromUnstructured(u *unstructured.Unstructured) *UnstructuredObject
func New ¶
func New() *UnstructuredObject
func (*UnstructuredObject) Clear ¶
func (uo *UnstructuredObject) Clear()
func (*UnstructuredObject) Clone ¶
func (uo *UnstructuredObject) Clone() *UnstructuredObject
func (*UnstructuredObject) DeepCopy ¶ added in v2.20.0
func (uo *UnstructuredObject) DeepCopy() *UnstructuredObject
func (*UnstructuredObject) DeepCopyInto ¶ added in v2.20.0
func (uo *UnstructuredObject) DeepCopyInto(out *UnstructuredObject)
func (*UnstructuredObject) GetK8sAnnotation ¶
func (uo *UnstructuredObject) GetK8sAnnotation(name string) *string
func (*UnstructuredObject) GetK8sAnnotationBool ¶ added in v2.22.0
func (uo *UnstructuredObject) GetK8sAnnotationBool(name string, defaultValue bool) (bool, error)
func (*UnstructuredObject) GetK8sAnnotationBoolNoError ¶ added in v2.22.0
func (uo *UnstructuredObject) GetK8sAnnotationBoolNoError(name string, defaultValue bool) bool
func (*UnstructuredObject) GetK8sAnnotationBoolPtr ¶ added in v2.22.0
func (uo *UnstructuredObject) GetK8sAnnotationBoolPtr(name string) (*bool, error)
func (*UnstructuredObject) GetK8sAnnotations ¶
func (uo *UnstructuredObject) GetK8sAnnotations() map[string]string
func (*UnstructuredObject) GetK8sAnnotationsWithRegex ¶
func (uo *UnstructuredObject) GetK8sAnnotationsWithRegex(r interface{}) map[string]string
func (*UnstructuredObject) GetK8sCreationTime ¶
func (uo *UnstructuredObject) GetK8sCreationTime() time.Time
func (*UnstructuredObject) GetK8sGVK ¶
func (uo *UnstructuredObject) GetK8sGVK() schema.GroupVersionKind
func (*UnstructuredObject) GetK8sGeneration ¶ added in v2.19.2
func (uo *UnstructuredObject) GetK8sGeneration() int64
func (*UnstructuredObject) GetK8sLabel ¶
func (uo *UnstructuredObject) GetK8sLabel(name string) *string
func (*UnstructuredObject) GetK8sLabels ¶
func (uo *UnstructuredObject) GetK8sLabels() map[string]string
func (*UnstructuredObject) GetK8sLabelsWithRegex ¶
func (uo *UnstructuredObject) GetK8sLabelsWithRegex(r interface{}) map[string]string
func (*UnstructuredObject) GetK8sManagedFields ¶
func (uo *UnstructuredObject) GetK8sManagedFields() []*UnstructuredObject
func (*UnstructuredObject) GetK8sName ¶
func (uo *UnstructuredObject) GetK8sName() string
func (*UnstructuredObject) GetK8sNamespace ¶
func (uo *UnstructuredObject) GetK8sNamespace() string
func (*UnstructuredObject) GetK8sOwnerReferences ¶
func (uo *UnstructuredObject) GetK8sOwnerReferences() []*UnstructuredObject
func (*UnstructuredObject) GetK8sRef ¶
func (uo *UnstructuredObject) GetK8sRef() k8s.ObjectRef
func (*UnstructuredObject) GetK8sResourceVersion ¶
func (uo *UnstructuredObject) GetK8sResourceVersion() string
func (*UnstructuredObject) GetK8sUid ¶ added in v2.20.0
func (uo *UnstructuredObject) GetK8sUid() string
func (*UnstructuredObject) GetNestedBool ¶ added in v2.20.0
func (uo *UnstructuredObject) GetNestedBool(keys ...interface{}) (bool, bool, error)
func (*UnstructuredObject) GetNestedField ¶
func (uo *UnstructuredObject) GetNestedField(keys ...interface{}) (interface{}, bool, error)
func (*UnstructuredObject) GetNestedInt ¶
func (uo *UnstructuredObject) GetNestedInt(keys ...interface{}) (int64, bool, error)
func (*UnstructuredObject) GetNestedList ¶
func (uo *UnstructuredObject) GetNestedList(keys ...interface{}) ([]interface{}, bool, error)
func (*UnstructuredObject) GetNestedObject ¶
func (uo *UnstructuredObject) GetNestedObject(keys ...interface{}) (*UnstructuredObject, bool, error)
func (*UnstructuredObject) GetNestedObjectList ¶
func (uo *UnstructuredObject) GetNestedObjectList(keys ...interface{}) ([]*UnstructuredObject, bool, error)
func (*UnstructuredObject) GetNestedObjectListNoErr ¶
func (uo *UnstructuredObject) GetNestedObjectListNoErr(keys ...interface{}) []*UnstructuredObject
func (*UnstructuredObject) GetNestedString ¶
func (uo *UnstructuredObject) GetNestedString(keys ...interface{}) (string, bool, error)
func (*UnstructuredObject) GetNestedStringList ¶
func (uo *UnstructuredObject) GetNestedStringList(keys ...interface{}) ([]string, bool, error)
func (*UnstructuredObject) GetNestedStringMapCopy ¶
func (uo *UnstructuredObject) GetNestedStringMapCopy(keys ...interface{}) (map[string]string, bool, error)
func (*UnstructuredObject) IsZero ¶
func (uo *UnstructuredObject) IsZero() bool
func (*UnstructuredObject) Keys ¶ added in v2.23.0
func (uo *UnstructuredObject) Keys() []string
func (*UnstructuredObject) MarshalJSON ¶ added in v2.20.0
func (uo *UnstructuredObject) MarshalJSON() ([]byte, error)
func (*UnstructuredObject) Merge ¶
func (uo *UnstructuredObject) Merge(other *UnstructuredObject)
func (*UnstructuredObject) MergeChild ¶
func (uo *UnstructuredObject) MergeChild(child string, other *UnstructuredObject)
func (*UnstructuredObject) MergeCopy ¶
func (uo *UnstructuredObject) MergeCopy(other *UnstructuredObject) *UnstructuredObject
func (*UnstructuredObject) NewIterator ¶
func (uo *UnstructuredObject) NewIterator() *ObjectIterator
func (*UnstructuredObject) RemoveFieldsByPathRegex ¶ added in v2.19.4
func (uo *UnstructuredObject) RemoveFieldsByPathRegex(path string) error
func (*UnstructuredObject) RemoveK8sAnnotation ¶ added in v2.21.0
func (uo *UnstructuredObject) RemoveK8sAnnotation(name string)
func (*UnstructuredObject) RemoveNestedField ¶
func (uo *UnstructuredObject) RemoveNestedField(keys ...interface{}) error
func (*UnstructuredObject) RemoveValueForKey ¶ added in v2.23.0
func (uo *UnstructuredObject) RemoveValueForKey(key string)
func (*UnstructuredObject) ReplaceKeys ¶
func (uo *UnstructuredObject) ReplaceKeys(oldKey string, newKey string) error
func (*UnstructuredObject) ReplaceValues ¶
func (uo *UnstructuredObject) ReplaceValues(oldValue interface{}, newValue interface{}) error
func (*UnstructuredObject) SetK8sAnnotation ¶
func (uo *UnstructuredObject) SetK8sAnnotation(name string, value string)
func (*UnstructuredObject) SetK8sAnnotations ¶
func (uo *UnstructuredObject) SetK8sAnnotations(annotations map[string]string)
func (*UnstructuredObject) SetK8sGVK ¶
func (uo *UnstructuredObject) SetK8sGVK(gvk schema.GroupVersionKind)
func (*UnstructuredObject) SetK8sGVKs ¶
func (uo *UnstructuredObject) SetK8sGVKs(g string, v string, k string)
func (*UnstructuredObject) SetK8sLabel ¶
func (uo *UnstructuredObject) SetK8sLabel(name string, value string)
func (*UnstructuredObject) SetK8sLabels ¶
func (uo *UnstructuredObject) SetK8sLabels(labels map[string]string)
func (*UnstructuredObject) SetK8sName ¶
func (uo *UnstructuredObject) SetK8sName(name string)
func (*UnstructuredObject) SetK8sNamespace ¶
func (uo *UnstructuredObject) SetK8sNamespace(namespace string)
func (*UnstructuredObject) SetK8sOwnerReferences ¶ added in v2.23.4
func (uo *UnstructuredObject) SetK8sOwnerReferences(l []*UnstructuredObject)
func (*UnstructuredObject) SetK8sResourceVersion ¶
func (uo *UnstructuredObject) SetK8sResourceVersion(rv string)
func (*UnstructuredObject) SetNestedField ¶
func (uo *UnstructuredObject) SetNestedField(value interface{}, keys ...interface{}) error
func (*UnstructuredObject) SetNestedFieldDefault ¶
func (uo *UnstructuredObject) SetNestedFieldDefault(defaultValue interface{}, keys ...interface{}) error
func (*UnstructuredObject) SetNestedObjectList ¶
func (uo *UnstructuredObject) SetNestedObjectList(items []*UnstructuredObject, keys ...interface{}) error
func (*UnstructuredObject) SetValueForKey ¶ added in v2.23.0
func (uo *UnstructuredObject) SetValueForKey(key string, value any)
func (*UnstructuredObject) ToMap ¶ added in v2.14.0
func (uo *UnstructuredObject) ToMap() (map[string]any, error)
ToMap will ensure that only plain go values are returned, meaning that all internal structs are converted to maps
func (*UnstructuredObject) ToStruct ¶
func (uo *UnstructuredObject) ToStruct(out interface{}) error
func (*UnstructuredObject) ToUnstructured ¶
func (uo *UnstructuredObject) ToUnstructured() *unstructured.Unstructured
func (*UnstructuredObject) UnmarshalJSON ¶ added in v2.20.0
func (uo *UnstructuredObject) UnmarshalJSON(b []byte) error
func (*UnstructuredObject) ValueForKey ¶ added in v2.23.0
func (uo *UnstructuredObject) ValueForKey(key string) (value any, has bool)
Click to show internal directories.
Click to hide internal directories.