xform

package
v0.0.0-...-83429da Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFilters

func RunFilters(ctx context.Context, resourceList *framework.ResourceList, filters ...yaml.Filter) error

RunFilters executes the specified filters against the provided resources.

func RunXform

func RunXform(ctx context.Context, fn TransformFunc) error

RunXform executes the specifies function against stdin/stdout.

Types

type FieldClearer

type FieldClearer struct {
	FieldPaths []FieldPath

	// Predicate matches against the name of the field or key in the map.
	Predicate func(string) bool
}

FieldClearer removes fields at the specified FieldPaths, that match the predicate.

func (FieldClearer) Filter

func (c FieldClearer) Filter(rn *yaml.RNode) (*yaml.RNode, error)

Filter implements the yaml filtering logic.

type FieldPath

type FieldPath []string

FieldPath specifies the address of a field.

func ParseFieldPath

func ParseFieldPath(fieldPath string) (FieldPath, error)

ParseFieldPath parses a string into a FieldPath. We may in future support jsonpath or similar, for now we simply support dot-separated field paths.

func ParseFieldPaths

func ParseFieldPaths(fieldPaths []string) ([]FieldPath, error)

ParseFieldPaths parses string slice into a FieldPath slice. This simplifies error handling.

type Runnable

type Runnable interface {
	Run(ctx context.Context, resourceList *framework.ResourceList) error
}

Runnable defines the contract for transform objects.

type TransformFunc

type TransformFunc func(ctx context.Context, resourceList *framework.ResourceList) error

TransformFunc defines the signature of a transformation function.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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