search

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PathDelimiter = "."

Variables

This section is empty.

Functions

func VisitElements added in v0.38.0

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 SearchReplace

type SearchReplace struct {
	// ByValue is the value of the field to be matched
	ByValue string

	// ByValueRegex is the value regex of the field to be matched
	ByValueRegex string

	// ByPath is the path of the field to be matched
	ByPath string

	// Count is the number of matches
	Count int

	// PutLiteral is the literal to be put at to field
	// filtered by path and/or value
	PutLiteral string

	// PutPattern is the setters reference comment to be added at to field
	PutPattern string

	PackagePath string

	// Result stores the result of executing the command
	Result []SearchResult
	// contains filtered or unexported fields
}

SearchReplace struct holds the input parameters and results for Search and Replace operations on resource configs

func (*SearchReplace) Filter

func (sr *SearchReplace) Filter(object *yaml.RNode) (*yaml.RNode, error)

Filter parses input node and performs search and replace operation on the node

func (*SearchReplace) Perform

func (sr *SearchReplace) Perform(resourcesPath string) error

Perform performs the search and replace operation on each node in the package path

type SearchResult added in v0.38.0

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

	// field path of the matching field
	FieldPath string

	// value of the matching field
	Value string
}

Jump to

Keyboard shortcuts

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