applysetters

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const SetterCommentIdentifier = "# kpt-set: "

Variables

This section is empty.

Functions

func Decode

func Decode(rn *yaml.RNode, fcd *ApplySetters)

Decode decodes the input yaml node into Set struct

func VisitElements

func VisitElements(rn *yaml.RNode, fn func(node *yaml.RNode, i int) error) error

VisitElements calls fn for each element in a SequenceNode. Returns an error for non-SequenceNodes

Types

type ApplySetters

type ApplySetters struct {
	// Setters holds the user provided values for all the setters
	Setters []Setter

	// Results are the results of applying setter values
	Results []*Result
	// contains filtered or unexported fields
}

ApplySetters applies the setter values to the resource fields which are tagged by the setter reference comments

func (*ApplySetters) Filter

func (as *ApplySetters) Filter(nodes []*yaml.RNode) ([]*yaml.RNode, error)

Filter implements Set as a yaml.Filter

type Result

type Result struct {
	// FilePath is the file path of the matching field
	FilePath string

	// FieldPath is field path of the matching field
	FieldPath string

	// Value of the matching field
	Value string
}

Result holds result of search and replace operation

type Setter

type Setter struct {
	// Name is the name of the setter
	Name string

	// Value is the input value for setter
	Value string
}

Jump to

Keyboard shortcuts

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