transformers

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package transformers provide mergo transformers for Kubernetes objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransformerMap added in v0.1.4

type TransformerMap map[reflect.Type]func(dst, src reflect.Value) error

TransformerMap is a mergo.Transformers implementation.

var PodSpec TransformerMap

PodSpec mergo transformers for corev1.PodSpec.

func (*TransformerMap) MergeListByKey added in v0.1.4

func (s *TransformerMap) MergeListByKey(key string, opts ...func(*mergo.Config)) func(_, _ reflect.Value) error

MergeListByKey merges two list by element key (eg. merge []corev1.Container by name). If mergo.WithAppendSlice options is passed, the list is extended, while elemnts with same name are merged. If not, the list is filtered to elements in src.

func (*TransformerMap) NilOtherFields added in v0.1.7

func (s *TransformerMap) NilOtherFields(opts ...func(*mergo.Config)) func(_, _ reflect.Value) error

NilOtherFields nils all fields not defined in src.

func (*TransformerMap) OverrideFields added in v0.1.4

func (s *TransformerMap) OverrideFields(fields ...string) func(_, _ reflect.Value) error

OverrideFields when merging override fields even if they are zero values (eg. nil or empty list).

func (TransformerMap) Transformer added in v0.1.4

func (s TransformerMap) Transformer(t reflect.Type) func(dst, src reflect.Value) error

Transformer implements mergo.Tansformers interface for TransformenrMap.

Jump to

Keyboard shortcuts

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