Documentation
¶
Index ¶
- func EvaluateOption(value interface{}, option execution.Option, fldPath *field.Path) (string, *field.Error)
- func EvaluateOptionBool(value interface{}, cfg *execution.BoolOptionConfig, fldPath *field.Path) (string, *field.Error)
- func EvaluateOptionDate(value interface{}, option execution.Option, cfg *execution.DateOptionConfig, ...) (string, *field.Error)
- func EvaluateOptionDefault(option execution.Option) (string, error)
- func EvaluateOptionDefaultBool(cfg *execution.BoolOptionConfig) (string, error)
- func EvaluateOptionDefaultMulti(cfg *execution.MultiOptionConfig) (string, error)
- func EvaluateOptionDefaultSelect(cfg *execution.SelectOptionConfig) (string, error)
- func EvaluateOptionDefaultString(cfg *execution.StringOptionConfig) (string, error)
- func EvaluateOptionMulti(value interface{}, option execution.Option, cfg *execution.MultiOptionConfig, ...) (string, *field.Error)
- func EvaluateOptionSelect(value interface{}, option execution.Option, cfg *execution.SelectOptionConfig, ...) (string, *field.Error)
- func EvaluateOptionString(value interface{}, option execution.Option, cfg *execution.StringOptionConfig, ...) (string, *field.Error)
- func EvaluateOptions(options map[string]interface{}, cfg *execution.OptionSpec, fldPath *field.Path) (map[string]string, field.ErrorList)
- func FilterParametersWithPrefix(parameters map[string]string, prefix string) map[string]string
- func FilterParametersWithPrefixes(parameters map[string]string, prefixes ...string) map[string]string
- func FormatAsMoment(ts time.Time, format string) (string, error)
- func GetDefaultingOption(option execution.Option) execution.Option
- func GetDefaultingOptionBool(option execution.Option) execution.Option
- func GetOptionDefaultBoolValue(cfg *execution.BoolOptionConfig) bool
- func GetOptionDefaultDateValue(_ *execution.DateOptionConfig) string
- func GetOptionDefaultMultiValue(cfg *execution.MultiOptionConfig) []string
- func GetOptionDefaultSelectValue(cfg *execution.SelectOptionConfig) string
- func GetOptionDefaultStringValue(cfg *execution.StringOptionConfig) string
- func GetOptionDefaultValue(option execution.Option) (interface{}, error)
- func HasAnyPrefix(s string, prefixes []string) bool
- func HashOptionSpec(spec *execution.OptionSpec) (string, error)
- func MakeDefaultOptions(cfg *execution.OptionSpec) (map[string]string, error)
- func MakeOptionVariableName(option execution.Option) string
- func MergeSubstitutions(paramMaps ...map[string]string) map[string]string
- func MutateDefaultingOptionSpec(spec *execution.OptionSpec) *execution.OptionSpec
- func NewForbiddenOptionConfigError(fldPath *field.Path, optionType execution.OptionType) *field.Error
- func SubstituteEmptyStringForPrefixes(target string, prefixes []string) string
- func SubstituteVariableMaps(target string, submaps []map[string]string, prefixes []string) string
- func SubstituteVariables(target string, submap map[string]string) string
- func ValidateBoolOptionConfig(cfg *execution.BoolOptionConfig, fldPath *field.Path) field.ErrorList
- func ValidateMultiOptionConfig(cfg *execution.MultiOptionConfig, fldPath *field.Path) field.ErrorList
- func ValidateOption(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionBool(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionDate(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionMulti(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionName(name string, fldPath *field.Path) field.ErrorList
- func ValidateOptionSelect(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionSpec(spec *execution.OptionSpec, fldPath *field.Path) field.ErrorList
- func ValidateOptionString(option execution.Option, fldPath *field.Path) field.ErrorList
- func ValidateOptionType(optionType execution.OptionType, fldPath *field.Path) field.ErrorList
- func ValidateSelectOptionConfig(cfg *execution.SelectOptionConfig, fldPath *field.Path) field.ErrorList
- func ZeroForNonConfig(option execution.Option) execution.Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateOption ¶
func EvaluateOption(value interface{}, option execution.Option, fldPath *field.Path) (string, *field.Error)
EvaluateOption will evaluate the value of the option against the given Option configuration.
func EvaluateOptionBool ¶ added in v0.1.0
func EvaluateOptionBool( value interface{}, cfg *execution.BoolOptionConfig, fldPath *field.Path, ) (string, *field.Error)
EvaluateOptionBool evaluates the value of the Bool option.
func EvaluateOptionDate ¶ added in v0.1.0
func EvaluateOptionDate( value interface{}, option execution.Option, cfg *execution.DateOptionConfig, fldPath *field.Path, ) (string, *field.Error)
EvaluateOptionDate evaluates the value of the Date option.
func EvaluateOptionDefault ¶
EvaluateOptionDefault evaluates the default value of the option.
func EvaluateOptionDefaultBool ¶ added in v0.1.0
func EvaluateOptionDefaultBool(cfg *execution.BoolOptionConfig) (string, error)
EvaluateOptionDefaultBool evaluates the default value of the Bool option.
func EvaluateOptionDefaultMulti ¶ added in v0.1.0
func EvaluateOptionDefaultMulti(cfg *execution.MultiOptionConfig) (string, error)
EvaluateOptionDefaultMulti evaluates the default value of the Multi option.
func EvaluateOptionDefaultSelect ¶ added in v0.1.0
func EvaluateOptionDefaultSelect(cfg *execution.SelectOptionConfig) (string, error)
EvaluateOptionDefaultSelect evaluates the default value of the Select option.
func EvaluateOptionDefaultString ¶ added in v0.1.0
func EvaluateOptionDefaultString(cfg *execution.StringOptionConfig) (string, error)
EvaluateOptionDefaultString evaluates the default value of the String option.
func EvaluateOptionMulti ¶ added in v0.1.0
func EvaluateOptionMulti( value interface{}, option execution.Option, cfg *execution.MultiOptionConfig, fldPath *field.Path, ) (string, *field.Error)
EvaluateOptionMulti evaluates the value of the Multi option.
func EvaluateOptionSelect ¶ added in v0.1.0
func EvaluateOptionSelect( value interface{}, option execution.Option, cfg *execution.SelectOptionConfig, fldPath *field.Path, ) (string, *field.Error)
EvaluateOptionSelect evaluates the value of the Select option.
func EvaluateOptionString ¶ added in v0.1.0
func EvaluateOptionString( value interface{}, option execution.Option, cfg *execution.StringOptionConfig, fldPath *field.Path, ) (string, *field.Error)
EvaluateOptionString evaluates the value of the String option.
func EvaluateOptions ¶
func EvaluateOptions( options map[string]interface{}, cfg *execution.OptionSpec, fldPath *field.Path, ) (map[string]string, field.ErrorList)
EvaluateOptions will evaluate all options in the given map.
func FilterParametersWithPrefix ¶
FilterParametersWithPrefix filters in keys from the given parameter map which have the provided prefix.
func FilterParametersWithPrefixes ¶
func FilterParametersWithPrefixes(parameters map[string]string, prefixes ...string) map[string]string
FilterParametersWithPrefixes filters in keys from the given parameter map which have any of the provided prefixes.
func FormatAsMoment ¶
FormatAsMoment formats the given time.Time with the moment.js format. The time.Location of ts will be used for formatting the given time.
func GetDefaultingOption ¶ added in v0.1.0
GetDefaultingOption returns an option with default fields populated.
func GetDefaultingOptionBool ¶ added in v0.1.0
GetDefaultingOptionBool returns a Bool option with default fields populated.
func GetOptionDefaultBoolValue ¶ added in v0.1.0
func GetOptionDefaultBoolValue(cfg *execution.BoolOptionConfig) bool
GetOptionDefaultBoolValue returns the default value of the Bool option.
func GetOptionDefaultDateValue ¶ added in v0.1.0
func GetOptionDefaultDateValue(_ *execution.DateOptionConfig) string
GetOptionDefaultDateValue returns the default value of the Date option.
func GetOptionDefaultMultiValue ¶ added in v0.1.0
func GetOptionDefaultMultiValue(cfg *execution.MultiOptionConfig) []string
GetOptionDefaultMultiValue returns the default value of the Multi option.
func GetOptionDefaultSelectValue ¶ added in v0.1.0
func GetOptionDefaultSelectValue(cfg *execution.SelectOptionConfig) string
GetOptionDefaultSelectValue returns the default value of the Select option.
func GetOptionDefaultStringValue ¶ added in v0.1.0
func GetOptionDefaultStringValue(cfg *execution.StringOptionConfig) string
GetOptionDefaultStringValue returns the default value of the String option.
func GetOptionDefaultValue ¶ added in v0.1.0
GetOptionDefaultValue returns the default option value prior to evaluation.
func HasAnyPrefix ¶
HasAnyPrefix tests whether the string s begins with at least one prefix in prefixes.
func HashOptionSpec ¶
func HashOptionSpec(spec *execution.OptionSpec) (string, error)
HashOptionSpec returns a deterministic hash of the given OptionSpec. This can be used to easily determine if two Specs are equal or not.
func MakeDefaultOptions ¶
func MakeDefaultOptions(cfg *execution.OptionSpec) (map[string]string, error)
MakeDefaultOptions returns a substitution map containing default values for all options in the given OptionSpec.
func MakeOptionVariableName ¶
MakeOptionVariableName returns the variable name for an option.
func MergeSubstitutions ¶
MergeSubstitutions merges the substitution maps, with the lowest priority first. Does not modify the maps in-place.
func MutateDefaultingOptionSpec ¶ added in v0.1.0
func MutateDefaultingOptionSpec(spec *execution.OptionSpec) *execution.OptionSpec
MutateDefaultingOptionSpec populates default fields for an OptionSpec in-place.
func NewForbiddenOptionConfigError ¶
func NewForbiddenOptionConfigError(fldPath *field.Path, optionType execution.OptionType) *field.Error
NewForbiddenOptionConfigError returns a validation error for an OptionType which contains config values other than its own Type.
func SubstituteEmptyStringForPrefixes ¶
SubstituteEmptyStringForPrefixes will perform substitution of any variables beginning with any of the given prefixes with an empty string. This should be performed as the last step of the substitution pipeline, since it would completely remove any variables that are not yet substituted. Example: SubstituteEmptyStringForPrefixes("echo ${job.unknown_variable};", []string{"job."}) => "echo ;"
func SubstituteVariableMaps ¶
SubstituteVariableMaps will perform variable substitution according to a list of substitution maps, in order of priority, most important substitution map first. Finally, it will substitute empty string for all the given prefixes.
func SubstituteVariables ¶
SubstituteVariables will perform variable substitution according to a substitution map. Example: SubstituteVariables("echo ${job.name}", map[string]string{"job.name": "jobconfig-sample.1650645000"})
func ValidateBoolOptionConfig ¶
ValidateBoolOptionConfig validates the BoolOptionConfig and returns a list of errors.
func ValidateMultiOptionConfig ¶
func ValidateMultiOptionConfig(cfg *execution.MultiOptionConfig, fldPath *field.Path) field.ErrorList
ValidateMultiOptionConfig validates the MultiOptionConfig and returns a list of errors.
func ValidateOption ¶ added in v0.1.0
ValidateOption validates the option and returns a list of errors.
func ValidateOptionBool ¶ added in v0.1.0
ValidateOptionBool validates the Bool option and returns a list of errors.
func ValidateOptionDate ¶ added in v0.1.0
ValidateOptionDate validates the Date option and returns a list of errors.
func ValidateOptionMulti ¶ added in v0.1.0
ValidateOptionMulti validates the Multi option and returns a list of errors.
func ValidateOptionName ¶ added in v0.1.0
ValidateOptionName validates the option's name and returns a list of errors.
func ValidateOptionSelect ¶ added in v0.1.0
ValidateOptionSelect validates the Select option and returns a list of errors.
func ValidateOptionSpec ¶
ValidateOptionSpec validates the OptionSpec and returns a list of errors.
func ValidateOptionString ¶ added in v0.1.0
ValidateOptionString validates the String option and returns a list of errors.
func ValidateOptionType ¶ added in v0.1.0
ValidateOptionType validates the OptionType and returns a list of errors.
func ValidateSelectOptionConfig ¶
func ValidateSelectOptionConfig(cfg *execution.SelectOptionConfig, fldPath *field.Path) field.ErrorList
ValidateSelectOptionConfig validates the SelectOptionConfig and returns a list of errors.
Types ¶
This section is empty.