template

package
v20.10.17+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 304

Documentation

Index

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

func ExtractVariables(configDict map[string]interface{}, pattern *regexp.Regexp) map[string]string

ExtractVariables returns a map of all the variables defined in the specified composefile (dict representation) and their default value if any.

func Substitute

func Substitute(template string, mapping Mapping) (string, error)

Substitute variables in the string with their values

func SubstituteWith

func SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, subsFuncs ...SubstituteFunc) (string, error)

SubstituteWith subsitute variables in the string with their values. It accepts additional substitute function.