Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultUnstructuredConverter performs unstructured to Go typed object conversions. DefaultUnstructuredConverter = &unstructuredConverter{ mismatchDetection: parseBool(os.Getenv("KUBE_PATCH_CONVERSION_DETECTOR")), comparison: conversion.EqualitiesOrDie( func(a, b time.Time) bool { return a.UTC() == b.UTC() }, ), } )
Functions ¶
func DeepCopyJSON ¶
DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func DeepCopyJSONValue ¶
func DeepCopyJSONValue(x interface{}) interface{}
DeepCopyJSONValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
Types ¶
type UnstructuredConverter ¶
type UnstructuredConverter interface { ToUnstructured(obj interface{}) (map[string]interface{}, error) FromUnstructured(u map[string]interface{}, obj interface{}) error }
UnstructuredConverter is an interface for converting between interface{} and map[string]interface representation.
func NewTestUnstructuredConverter ¶
func NewTestUnstructuredConverter(comparison conversion.Equalities) UnstructuredConverter
NewTestUnstructuredConverter creates an UnstructuredConverter that accepts JSON typed maps and translates them to Go types via reflection. It performs mismatch detection automatically and is intended for use by external test tools. Use DefaultUnstructuredConverter if you do not explicitly need mismatch detection.