regexp

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	Log logr.Logger
}

Extractor extracts all the S3 urls in a directory of manifests

func (*Extractor) Extract

func (e *Extractor) Extract(sourceDir string, regexps []string) ([]string, error)

Extract takes a source directory of manifests and slice of strings used to extract strings and returns a list of extracted strings

type Filter

type Filter struct {
	// Regexp a regular expression to match with
	Regexp string `yaml:"regexp"`

	// SetValue is called with the regular expression and RNode as a string
	SetValue SetFn
}

Filter is a kyaml Filter that applies regular expressions

func (*Filter) Filter

func (f *Filter) Filter(node *yaml.RNode) (*yaml.RNode, error)

Filter turns a RNode into a string and creates a Regexp from a string to run SetValue on

type SetFn

type SetFn func(*regexp.Regexp, string) error

SetFn takes a Regexp and a string and returns an error

type SliceFilter

type SliceFilter struct {
	// ReSlice is a slice of regular expressions for string extraction
	ReSlice []string `yaml:"reSlice"`

	// SetValue is called with for each regular expression and RNode as a string
	SetValue SetFn
}

SliceFilter is the spec for the kustomize function.

func (SliceFilter) Filter

func (f SliceFilter) Filter(node *yaml.RNode) (*yaml.RNode, error)

Filter makes an regexp Extractor out of each regexps in ReSlice runs them all

Jump to

Keyboard shortcuts

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