Help us shape the future of Go! Take the 2026 Go Developer Survey

transform

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(node, newNode *yaml.RNode) (err error)

Add adds the subset to the target at the path, appends to lists

func BuildFilters

func BuildFilters(targetNode *yaml.RNode, pathSlice []string) ([]yaml.Filter, error)

BuildFilters builds kyaml filters from a pathSlice

func CalcPath

func CalcPath(path string, cType ChangeType) ([]string, string, error)

func Delete

func Delete(node *yaml.RNode, lastSegment string, filters []yaml.Filter) (err error)

Deletes data at the path

func SetNodeAtPath

func SetNodeAtPath(rootNode *yaml.RNode, node *yaml.RNode, filters []yaml.Filter, pathSlice []string) error

SetNodeAtPath injects the updated node into rootNode according to the specified path

func Update

func Update(node, newNode *yaml.RNode) (*yaml.RNode, error)

Updates existing data at the path, overwrites lists

Types

type ChangeType

type ChangeType string
const (
	ChangeTypeAdd    ChangeType = "add"
	ChangeTypeUpdate ChangeType = "update"
	ChangeTypeDelete ChangeType = "delete"
)

type TransformTarget

type TransformTarget struct {
	RootNode *yaml.RNode
}

func CreateTransformTarget

func CreateTransformTarget(parent map[string]interface{}) (*TransformTarget, error)

func (*TransformTarget) ExecuteTransform

func (t *TransformTarget) ExecuteTransform(path string, cType ChangeType, value string, valueMap map[string]interface{}) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

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