Documentation ¶
Index ¶
- Variables
- func ExtractVariables(configDict map[string]any, pattern *regexp.Regexp) map[string]string
- func Substitute(template string, mapping Mapping) (string, error)
- func SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, ...) (string, error)
- type InvalidTemplateError
- type Mapping
- type SubstituteFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSubstituteFuncs = []SubstituteFunc{
softDefault,
hardDefault,
requiredNonEmpty,
required,
}
DefaultSubstituteFuncs contains the default SubstituteFunc used by the docker cli
Functions ¶
func ExtractVariables ¶
ExtractVariables returns a map of all the variables defined in the specified composefile (dict representation) and their default value if any.
func Substitute ¶
Substitute variables in the string with their values
func SubstituteWith ¶
func SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, subsFuncs ...SubstituteFunc) (string, error)
SubstituteWith substitutes variables in the string with their values. It accepts additional substitute function.
Types ¶
type InvalidTemplateError ¶
type InvalidTemplateError struct {
Template string
}
InvalidTemplateError is returned when a variable template is not in a valid format
func (InvalidTemplateError) Error ¶
func (e InvalidTemplateError) Error() string
Click to show internal directories.
Click to hide internal directories.