transformer

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTransformers added in v0.3.0

func ApplyTransformers(ctx context.Context, transformers []Transformer, objects []unstructured.Unstructured) ([]unstructured.Unstructured, error)

ApplyTransformers applies all transformer to each unstructured objects

func Name

func Name(trans Transformer) string

func NestedMap

func NestedMap(objMap map[string]interface{}, path string) (map[string]interface{}, bool)

func NestedMapDelete

func NestedMapDelete(objMap map[string]interface{}, path string) bool

func NestedSlice

func NestedSlice(objMap map[string]interface{}, path string) ([]interface{}, bool)

func ToObject

func ToObject(u map[string]interface{}, obj interface{}) error

ToObject makes Unstructured to object obj must to be the pointer of object struct

func ToUnstructured

func ToUnstructured(obj interface{}) (map[string]interface{}, error)

ToUnstructured makes object to a property of Unstructured object must be bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number or nil

Types

type JSONPatchTransformer

type JSONPatchTransformer struct {
	// contains filtered or unexported fields
}

func NewJSONPatchTransformer

func NewJSONPatchTransformer(json6902 []cosmov1alpha1.Json6902, instName string) *JSONPatchTransformer

func (*JSONPatchTransformer) Transform

type MetadataTransformer

type MetadataTransformer struct {
	// contains filtered or unexported fields
}

func NewMetadataTransformer

func NewMetadataTransformer(inst cosmov1alpha1.InstanceObject, scheme *runtime.Scheme, disableNamePrefix bool) *MetadataTransformer

func (*MetadataTransformer) Transform

type NetworkTransformer

type NetworkTransformer struct {
	// contains filtered or unexported fields
}

func NewNetworkTransformer

func NewNetworkTransformer(netSpec *cosmov1alpha1.NetworkOverrideSpec, instName string) *NetworkTransformer

func (*NetworkTransformer) Transform

type ScalingTransformer

type ScalingTransformer struct {
	// contains filtered or unexported fields
}

func NewScalingTransformer

func NewScalingTransformer(ScalingOverrideSpecs []cosmov1alpha1.ScalingOverrideSpec, instName string) *ScalingTransformer

func (*ScalingTransformer) Transform

type Transformer

type Transformer interface {
	Transform(*unstructured.Unstructured) (*unstructured.Unstructured, error)
}

Transformer is interface to modify unstructured object

func AllTransformers added in v0.5.0

func AllTransformers(inst cosmov1alpha1.InstanceObject, scheme *runtime.Scheme, tmpl cosmov1alpha1.TemplateObject) []Transformer

Jump to

Keyboard shortcuts

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