Documentation
¶
Index ¶
Constants ¶
View Source
const (
RegexNameGroup = "NAME"
RegexNamespaceGroup = "NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func IndexBasedReplace ¶
func IndexBasedReplace(input string, items []IndexBasedReplaceItem) string
IndexBasedReplace replaces multiple substrings in the input string with the replacement values based on the indexes in the original input string. input - string that will have parts of it replaced items - slice of IndexBasedRelaceItem(s). Only nonoverlaping index pairs are supported.
func PrepareRegex ¶
func PrepareRegex(regex string) (*regexp.Regexp, error)
func ProcessRegex ¶
func ProcessRegex(regex *regexp.Regexp, input string, translateFunc TranslateFunc) string
Types ¶
type IndexBasedReplaceItem ¶
type IndexBasedReplaceItem struct {
StartIndex int
EndIndex int
Replacement string
}
type TranslateFunc ¶ added in v0.16.0
type TranslateFunc func(name, namespace string) types.NamespacedName
Click to show internal directories.
Click to hide internal directories.