Documentation ¶
Overview ¶
Package template provides TemplateProcessor, capable of transforming Template objects into Config objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddParameter ¶
AddParameter adds new custom parameter to the Template. It overrides the existing parameter, if already defined.
Types ¶
type Processor ¶
type Processor struct {
Generators map[string]Generator
}
Processor process the Template into the List with substituted parameters
func NewProcessor ¶
NewProcessor creates new Processor and initializes its set of generators.
func (*Processor) GenerateParameterValues ¶
GenerateParameterValues generates Value for each Parameter of the given Template that has Generate field specified where Value is not already supplied.
Examples:
from | value ----------------------------- "test[0-9]{1}x" | "test7x" "[0-1]{8}" | "01001100" "0x[A-F0-9]{4}" | "0xB3AF" "[a-zA-Z0-9]{8}" | "hW4yQU5i"
func (*Processor) Process ¶
func (p *Processor) Process(template *api.Template) fielderrors.ValidationErrorList
Process transforms Template object into List object. It generates Parameter values using the defined set of generators first, and then it substitutes all Parameter expression occurrences with their corresponding values (currently in the containers' Environment variables only).
func (*Processor) SubstituteParameters ¶
func (p *Processor) SubstituteParameters(params []api.Parameter, item runtime.Object) (runtime.Object, error)
SubstituteParameters loops over all values defined in structured and unstructured types that are children of item.
Example of Parameter expression:
- ${PARAMETER_NAME}
Directories ¶
Path | Synopsis |
---|---|
Package api defines and registers types for Template objects.
|
Package api defines and registers types for Template objects. |
validation
Package validation has functions for validating the correctness of Template objects and explaining what is wrong with them when they aren't valid.
|
Package validation has functions for validating the correctness of Template objects and explaining what is wrong with them when they aren't valid. |
Package generator defines GeneratorInterface interface and implements some random value generators.
|
Package generator defines GeneratorInterface interface and implements some random value generators. |
examples
Package examples demonstrates possible implementation of some random value generators.
|
Package examples demonstrates possible implementation of some random value generators. |