unstructured

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func DeepCopyJSON(x map[string]interface{}) map[string]interface{}

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.

Jump to

Keyboard shortcuts

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