Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyInput is returned when we try to modify an empty value ErrEmptyInput = errors.New("validation error: transformer input is empty") )
Functions ¶
This section is empty.
Types ¶
type FindSubMatch ¶ added in v0.21.0
type FindSubMatch struct { // Pattern defines regular expression to use for retrieving a submatch Pattern string DeprecatedCaptureIndex int `yaml:"captureIndex"` // CaptureIndex defines which substring occurrence to retrieve. Note also that a value of `0` for `captureIndex` returns all submatches, and individual submatch indexes start at `1`. CaptureIndex int }
FindSubMatch is a struct used to feed regexp.findSubMatch
func (*FindSubMatch) Apply ¶ added in v0.25.0
func (f *FindSubMatch) Apply(input string) (string, error)
func (*FindSubMatch) Validate ¶ added in v0.25.0
func (f *FindSubMatch) Validate() error
type Replacer ¶
type Replacer struct { // From defines the source value which need to be replaced From string // To defines the "to what" a "from" value needs to be replaced To string }
Replacer is struct used to feed strings.Replacer
type Transformer ¶
type Transformer struct { // AddPrefix adds a prefix to the transformer input value AddPrefix string DeprecatedAddPrefix string `yaml:"addPrefix" jsonschema:"-"` // AddSuffix adds a suffix to the transformer input value AddSuffix string DeprecatedAddSuffix string `yaml:"addSuffix" jsonschema:"-"` // TrimPrefix removes a prefix to the transformer input value TrimPrefix string DeprecatedTrimPrefix string `yaml:"trimPrefix" jsonschema:"-"` // TrimSuffix removes the suffix from the transformer input value TrimSuffix string DeprecatedTrimSuffix string `yaml:"trimSuffix" jsonschema:"-"` // Replacers specifies a list of replacer instruction Replacers Replacers // Replacer specifies what value needs to be changed and how Replacer Replacer // Find searches for a specific value if it exists and return false if it doesn't Find string // Find searches for a specific value if it exists then return the value using regular expression FindSubMatch FindSubMatch DeprecatedFindSubMatch interface{} `yaml:"findSubMatch" jsonschema:"-"` // SemvVerInc specifies a comma separated list semantic versioning component that needs to be upgraded. SemVerInc string DeprecatedSemVerInc string `yaml:"semverInc" jsonschema:"-"` }
Transformer holds a tranformer rule
func (*Transformer) Apply ¶
func (t *Transformer) Apply(input string) (output string, err error)
Apply applies a single transformation based on a key
func (*Transformer) Validate ¶ added in v0.25.0
func (t *Transformer) Validate() error
type Transformers ¶
type Transformers []Transformer
Transformers defines a list of transformer applied in order
func (*Transformers) Apply ¶
func (t *Transformers) Apply(input string) (string, error)
Apply applies a list of transformers
func (*Transformers) Validate ¶ added in v0.25.0
func (t *Transformers) Validate() error
Click to show internal directories.
Click to hide internal directories.